cs015.Swarm
Class MoveBehavior

java.lang.Object
  extended byNGP.Timer
      extended bycs015.Swarm.BeeBehavior
          extended bycs015.Swarm.MoveBehavior
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener
Direct Known Subclasses:
FollowLeaderBehavior, MoveRandomlyBehavior

public abstract class MoveBehavior
extends BeeBehavior

This class represents an abstract superclass for all behaviors that move a class implementing the Directional interface.

See Also:
BeeBehavior

Constructor Summary
MoveBehavior()
          This constructor builds a MoveBehavior with a null target.
MoveBehavior(Directional target)
          This constructor builds a MoveBehavior with a directional as its target.
 
Method Summary
 void activate()
          This method is called at regular intervals.
 
Methods inherited from class cs015.Swarm.BeeBehavior
copy, getTarget, setTarget
 
Methods inherited from class NGP.Timer
actionPerformed, getDelay, setDelay, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoveBehavior

public MoveBehavior()
This constructor builds a MoveBehavior with a null target.


MoveBehavior

public MoveBehavior(Directional target)
This constructor builds a MoveBehavior with a directional as its target.

Parameters:
target - The target this behavior will work on.
Method Detail

activate

public void activate()
This method is called at regular intervals. It moves the Directional its superclass has a reference to along the vector which represents the Directional's speed and direction.