sample.tank
Class BackAndForward

java.lang.Object
  extended by net.sf.tankbattles.simulation.tank.AbstractTankController
      extended by sample.tank.BackAndForward
All Implemented Interfaces:
java.lang.Runnable

public class BackAndForward
extends AbstractTankController

Sample implementation of a tank controller. Just makes the tank go ahead, brake, go back and brake again.

Author:
erickpassos

Constructor Summary
BackAndForward()
           
 
Method Summary
 void onRadarDetection(RadarDetectionEvent event)
           
 void run()
          Main method for managing the tank behavior.
 
Methods inherited from class net.sf.tankbattles.simulation.tank.AbstractTankController
isAlive, onCollision, onHitByBullet, setLock, setTankNode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackAndForward

public BackAndForward()
Method Detail

run

public void run()
Main method for managing the tank behavior. Each Tank is controlled by its own thread, which executes this run() method.


onRadarDetection

public void onRadarDetection(RadarDetectionEvent event)
Overrides:
onRadarDetection in class AbstractTankController