|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.action.Actor net.jinx.action.input.Participant
public abstract class Participant
Participant is the base superclass of any kind of Actor that is actively
self guiding. This includes both computer and human controlled Actors.
API Stability: Beta.
Constructor Summary | |
---|---|
protected |
Participant(java.lang.String name)
Constructors a new Participant. |
protected |
Participant(java.lang.String name,
Behavior b)
Utility constructor that allows setting the Behavior. |
Method Summary | |
---|---|
Behavior |
getBehavior()
Provides the current Behavior for this Participant. |
abstract Condition |
getCondition()
Provides the Condition object for this Participant. |
abstract void |
processAction(Action action)
Should be called by Behavior to process the actions it produces. |
protected void |
processEvent(ActorEvent event)
Ignores all events except ClockEvent instances. |
void |
setBehavior(Behavior b)
Sets the Behavior for this Participant. |
protected void |
step(float dt)
Calls the Behavior's act(Participant, float) method. |
Methods inherited from class net.jinx.action.Actor |
---|
checkAllowAdd, getName, getOwner, hashCode, ownerChanged, sendEvent, sendEvent, sendEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Participant(java.lang.String name)
name
- the name for this Participant.protected Participant(java.lang.String name, Behavior b)
name
- the name for this Participant.b
- the Behavior to use.Method Detail |
---|
public void setBehavior(Behavior b)
b
- the Behavior to use. Setting this to null will disable the
Participant and cause it to stop acting on it's own. This can be good
for dead participants, but may not fit quite correctly.public Behavior getBehavior()
protected void processEvent(ActorEvent event)
processEvent
in class Actor
event
- the ActorEvent to process.protected void step(float dt)
dt
- the change in time value.public abstract Condition getCondition()
public abstract void processAction(Action action)
action
- the Action object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |