de.adom.jade.kernel
Class DefaultActor

java.lang.Object
  extended by de.adom.jade.kernel.GUIDCarrier
      extended by de.adom.jade.kernel.DefaultActor
All Implemented Interfaces:
Actor, java.io.Serializable
Direct Known Subclasses:
Being

public abstract class DefaultActor
extends GUIDCarrier
implements Actor

An actor is an abstract JADE concept for anything that can happen at a predetermined point in time. This simulates both one-time events (like exploding magical bombs), repetetitive events (like a log floating downstream) or intelligent beings (like monsters or the PC).

See Also:
Serialized Form

Constructor Summary
DefaultActor()
           
 
Method Summary
abstract  void act()
          Executes an action at a predetermined point in time.
 void actAgainAfter(long timeToPass)
          Reposts this actor to the actor queue of the current location after a certain amount of time has passed.
 long getActionPoint()
          Returns the point in time when this event is going to happen.
 boolean isValid()
          Determines whether this action still is going to happen when the time has come.
 void setActionPoint(long pointInTime)
          Sets the point in time when this actor is going to act.
 
Methods inherited from class de.adom.jade.kernel.GUIDCarrier
getGUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultActor

public DefaultActor()
Method Detail

act

public abstract void act()
Executes an action at a predetermined point in time.

Specified by:
act in interface Actor

setActionPoint

public void setActionPoint(long pointInTime)
Sets the point in time when this actor is going to act.

Parameters:
pointInTime - the point in time when this actor is going to act

getActionPoint

public long getActionPoint()
Returns the point in time when this event is going to happen.

Specified by:
getActionPoint in interface Actor
Returns:
the point in time when this action happens

isValid

public boolean isValid()
Determines whether this action still is going to happen when the time has come.

Specified by:
isValid in interface Actor
Returns:
true; by default all actors are always valid

actAgainAfter

public void actAgainAfter(long timeToPass)
Reposts this actor to the actor queue of the current location after a certain amount of time has passed.

Parameters:
timeToPass - the amount of time to pass before this actor is allowed to act again (in ticks)