com.planeth.gtroids.agents
Class AutoFire

java.lang.Object
  extended bycom.planeth.gtroids.agents.AutoFire
All Implemented Interfaces:
IThreadControllable

public class AutoFire
extends java.lang.Object
implements IThreadControllable

AutofFire agent
Fires a IGun automatic in a predefined intervall
It must be controlled by a Thread

Author:
Andreas Grässer, gal@planet-h.com.
created Jun 14, 2005
See Also:
TimedObjectThread, IGun

Constructor Summary
AutoFire(IGun gun, int repeatTime)
          Constructor for AutoFire.
 
Method Summary
 void doNextStep()
          Does the next step
 boolean isReadyToDie()
          Returns true, if the IThreadControllable is ready to die
Ready to die means, the Thread which controls the IThreadControllable, will terminate and the IThreadControllable will be deleted.
 void setReadyToDie()
          Sets the IThreadControllable ready to die.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoFire

public AutoFire(IGun gun,
                int repeatTime)
Constructor for AutoFire.

Parameters:
gun - the gun to be fired
repeatTime - the fire intervall
Method Detail

doNextStep

public void doNextStep()
Description copied from interface: IThreadControllable
Does the next step

Specified by:
doNextStep in interface IThreadControllable
See Also:
IThreadControllable.doNextStep()

isReadyToDie

public boolean isReadyToDie()
Description copied from interface: IThreadControllable
Returns true, if the IThreadControllable is ready to die
Ready to die means, the Thread which controls the IThreadControllable, will terminate and the IThreadControllable will be deleted.

Specified by:
isReadyToDie in interface IThreadControllable
Returns:
Returns true, if the IThreadControllable is ready to die
See Also:
IThreadControllable.isReadyToDie()

setReadyToDie

public void setReadyToDie()
Description copied from interface: IThreadControllable
Sets the IThreadControllable ready to die.

Specified by:
setReadyToDie in interface IThreadControllable
See Also:
IThreadControllable.setReadyToDie()