lane.sente
Class Robot

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--lane.sente.GameElement
              |
              +--lane.sente.AnimateGameElement
                    |
                    +--lane.sente.Robot
All Implemented Interfaces:
java.lang.Runnable

public class Robot
extends AnimateGameElement


Field Summary
protected  java.util.Vector listeners
           
protected  java.lang.String name
           
protected  RobotController theController
           
 
Fields inherited from class lane.sente.AnimateGameElement
theBattery, theTurret
 
Fields inherited from class lane.sente.GameElement
health, radius, theContainer, theLocation, theVelocity
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Robot(Location theLocation, Velocity theVelocity, int radius, int health, RobotContainer theContainer, RobotController theController)
          the constructor for the Robot
 
Method Summary
 void addListener(RobotListener listener)
          method to add a listener for this robot
 void AnimateGameElementSighting(AnimateGameElement element)
          method called when the robot sights an AnimateGameElement
 void collision(GameElement other)
          method called when this robot collides with another element
 void InanimateGameElementSighting(InanimateGameElement element)
          method called when the robot sights an InAnimateGameElement
 void run()
          the run method
protected  void updateListeners()
          used to update objects listening to the robot
 void xCollision()
          method called when the robot collides along the X wall
 void yCollision()
          method called when the robot collides along the Y wall
 void zCollision()
          method called when the robot collides along the Z wall
 
Methods inherited from class lane.sente.AnimateGameElement
getBattery, getTurret
 
Methods inherited from class lane.sente.GameElement
acceptDammage, getHealth, getLocation, getRadius, getVelocity, isCollision, setHealth, setLocation, setRadius
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

theController

protected RobotController theController

listeners

protected java.util.Vector listeners
Constructor Detail

Robot

public Robot(Location theLocation,
             Velocity theVelocity,
             int radius,
             int health,
             RobotContainer theContainer,
             RobotController theController)
the constructor for the Robot
Parameters:
theLocation - The location where this element begins
theVelocity - The velocity with which this element begins
radius - The radius of the element
health - The maximum health of this element
theContainer - The RobotContainer that holds this element
theController - The class that will controll this robot
Method Detail

run

public void run()
the run method
Overrides:
run in class java.lang.Thread

updateListeners

protected void updateListeners()
used to update objects listening to the robot
Overrides:
updateListeners in class GameElement

addListener

public void addListener(RobotListener listener)
method to add a listener for this robot
Parameters:
listener - The object that will listen to this object

collision

public void collision(GameElement other)
method called when this robot collides with another element
Overrides:
collision in class AnimateGameElement
Parameters:
other - The other element that this robot collided with

xCollision

public void xCollision()
method called when the robot collides along the X wall
Overrides:
xCollision in class GameElement

yCollision

public void yCollision()
method called when the robot collides along the Y wall
Overrides:
yCollision in class GameElement

zCollision

public void zCollision()
method called when the robot collides along the Z wall
Overrides:
zCollision in class GameElement

InanimateGameElementSighting

public void InanimateGameElementSighting(InanimateGameElement element)
method called when the robot sights an InAnimateGameElement
Parameters:
element - The sighted InAnimateElement

AnimateGameElementSighting

public void AnimateGameElementSighting(AnimateGameElement element)
method called when the robot sights an AnimateGameElement
Parameters:
element - The sighted AnimateElement