atavism.server.engine
Class BaseBehavior
java.lang.Object
atavism.server.engine.Behavior
atavism.server.engine.BaseBehavior
- All Implemented Interfaces:
- MessageCallback, MessageDispatch, java.io.Serializable, java.lang.Runnable
public class BaseBehavior
- extends Behavior
- implements java.lang.Runnable
- See Also:
- Serialized Form
Method Summary |
void |
activate()
|
protected void |
cancelPathInterpolator(OID oid,
Point currentLoc)
|
void |
deactivate()
|
void |
followSetup(EntityHandle target,
int speed,
float distance)
|
void |
followUpdate()
|
protected java.lang.String |
getPathObjectTypeName()
|
void |
gotoSetup(Point dest,
float speed)
|
void |
gotoUpdate()
|
void |
handleMessage(Message msg,
int flags)
Handle message. |
void |
initialize()
|
protected boolean |
interpolatePath()
|
void |
run()
|
protected void |
scheduleMe(long timeToDest)
|
protected long |
setupPathInterpolator(OID oid,
Point myLoc,
Point dest,
boolean follow,
float distanceToFollowAt,
boolean followsTerrain)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lock
protected transient java.util.concurrent.locks.Lock lock
mode
protected java.lang.String mode
roamingBehavior
protected boolean roamingBehavior
activated
protected boolean activated
task
protected java.util.concurrent.ScheduledFuture task
MSG_CMD_TYPE_GOTO
public static final java.lang.String MSG_CMD_TYPE_GOTO
- See Also:
- Constant Field Values
MSG_CMD_TYPE_FOLLOW
public static final java.lang.String MSG_CMD_TYPE_FOLLOW
- See Also:
- Constant Field Values
MSG_CMD_TYPE_STOP
public static final java.lang.String MSG_CMD_TYPE_STOP
- See Also:
- Constant Field Values
MSG_CMD_TYPE_DISABLE
public static final java.lang.String MSG_CMD_TYPE_DISABLE
- See Also:
- Constant Field Values
MSG_EVENT_TYPE_ARRIVED
public static final java.lang.String MSG_EVENT_TYPE_ARRIVED
- See Also:
- Constant Field Values
BaseBehavior
public BaseBehavior()
BaseBehavior
public BaseBehavior(SpawnData data)
initialize
public void initialize()
- Overrides:
initialize
in class Behavior
activate
public void activate()
- Specified by:
activate
in class Behavior
deactivate
public void deactivate()
- Specified by:
deactivate
in class Behavior
handleMessage
public void handleMessage(Message msg,
int flags)
- Description copied from interface:
MessageCallback
- Handle message.
- Specified by:
handleMessage
in interface MessageCallback
- Specified by:
handleMessage
in class Behavior
- Parameters:
msg
- Message sent from other agent.flags
- Bitwise OR of MessageCallback.NO_FLAGS
, MessageCallback.RESPONSE_EXPECTED
.
gotoSetup
public void gotoSetup(Point dest,
float speed)
gotoUpdate
public void gotoUpdate()
followSetup
public void followSetup(EntityHandle target,
int speed,
float distance)
scheduleMe
protected void scheduleMe(long timeToDest)
followUpdate
public void followUpdate()
setupPathInterpolator
protected long setupPathInterpolator(OID oid,
Point myLoc,
Point dest,
boolean follow,
float distanceToFollowAt,
boolean followsTerrain)
cancelPathInterpolator
protected void cancelPathInterpolator(OID oid,
Point currentLoc)
interpolatePath
protected boolean interpolatePath()
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
getPathObjectTypeName
protected java.lang.String getPathObjectTypeName()