Atavism Version 2018.1AGIS API

atavism.agis.behaviors
Class PatrolBehavior

java.lang.Object
  extended by atavism.server.engine.Behavior
      extended by atavism.agis.behaviors.PatrolBehavior
All Implemented Interfaces:
MessageCallback, MessageDispatch, java.io.Serializable, java.lang.Runnable

public class PatrolBehavior
extends Behavior
implements MessageCallback, java.lang.Runnable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class atavism.server.engine.Behavior
Behavior.CommandMessage, Behavior.EventMessage
 
Field Summary
protected  java.util.List<java.lang.Float> lingerTimes
           
protected  float speed
           
protected  java.util.List<Point> waypoints
           
 
Fields inherited from class atavism.server.engine.Behavior
lock, MSG_TYPE_COMMAND, MSG_TYPE_EVENT, obj
 
Fields inherited from interface atavism.msgsys.MessageCallback
NO_FLAGS, RESPONSE_EXPECTED
 
Constructor Summary
PatrolBehavior()
           
PatrolBehavior(SpawnData data)
           
 
Method Summary
 void activate()
           
 void addLingerTime(float time)
           
 void addWaypoint(Point wp)
           
 void deactivate()
           
 java.util.List<java.lang.Float> getLingerTimes()
           
 float getMovementSpeed()
           
 void handleMessage(Message msg, int flags)
          Handle message.
 void initialize()
           
protected  void nextPatrol()
           
 void run()
           
protected  void sendMessage(Point waypoint, float speed)
           
 void setMovementSpeed(float speed)
           
protected  void startPatrol()
          Calculate the current position of the mob and work out where along the chain they are
 
Methods inherited from class atavism.server.engine.Behavior
dispatchMessage, getObjectStub, setObjectStub
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

waypoints

protected java.util.List<Point> waypoints

lingerTimes

protected java.util.List<java.lang.Float> lingerTimes

speed

protected float speed
Constructor Detail

PatrolBehavior

public PatrolBehavior()

PatrolBehavior

public PatrolBehavior(SpawnData data)
Method Detail

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.

addWaypoint

public void addWaypoint(Point wp)

addLingerTime

public void addLingerTime(float time)

getLingerTimes

public java.util.List<java.lang.Float> getLingerTimes()

setMovementSpeed

public void setMovementSpeed(float speed)

getMovementSpeed

public float getMovementSpeed()

startPatrol

protected void startPatrol()
Calculate the current position of the mob and work out where along the chain they are


sendMessage

protected void sendMessage(Point waypoint,
                           float speed)

nextPatrol

protected void nextPatrol()

run

public void run()
Specified by:
run in interface java.lang.Runnable


Copyright © 2018 Dragonsan Studios Sp. z o.o.