public class RadiusRoamBehavior extends Behavior implements MessageCallback, java.lang.Runnable
Behavior.CommandMessage, Behavior.EventMessage
Modifier and Type | Field and Description |
---|---|
protected boolean |
activated |
protected Point |
centerLoc |
protected long |
lingerTime |
protected int |
radius |
protected float |
speed |
lock, MSG_TYPE_COMMAND, MSG_TYPE_EVENT, obj
NO_FLAGS, RESPONSE_EXPECTED
Constructor and Description |
---|
RadiusRoamBehavior() |
RadiusRoamBehavior(SpawnData data) |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
void |
deactivate() |
Point |
getCenterLoc() |
long |
getLingerTime() |
float |
getMovementSpeed() |
int |
getRadius() |
void |
handleMessage(Message msg,
int flags)
Handle message.
|
void |
initialize() |
protected void |
nextRoam() |
void |
run() |
void |
setCenterLoc(Point loc) |
void |
setLingerTime(long time) |
void |
setMovementSpeed(float speed) |
void |
setRadius(int radius) |
protected void |
startRoam() |
dispatchMessage, getObjectStub, setObjectStub
protected Point centerLoc
protected int radius
protected long lingerTime
protected float speed
protected boolean activated
public RadiusRoamBehavior()
public RadiusRoamBehavior(SpawnData data)
public void initialize()
initialize
in class Behavior
public void deactivate()
deactivate
in class Behavior
public void handleMessage(Message msg, int flags)
MessageCallback
handleMessage
in interface MessageCallback
handleMessage
in class Behavior
msg
- Message sent from other agent.flags
- Bitwise OR of MessageCallback.NO_FLAGS
, MessageCallback.RESPONSE_EXPECTED
.public void setCenterLoc(Point loc)
public Point getCenterLoc()
public void setRadius(int radius)
public int getRadius()
public void setLingerTime(long time)
public long getLingerTime()
public void setMovementSpeed(float speed)
public float getMovementSpeed()
protected void startRoam()
protected void nextRoam()
public void run()
run
in interface java.lang.Runnable