lane.sente
Class AnimateGameElement

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

public abstract class AnimateGameElement
extends GameElement

This class adds meathods and information needed by the active elements (such as a battery and turret)


Field Summary
protected  Battery theBattery
           
protected  Turret 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
AnimateGameElement(Location theLocation, Velocity theVelocity, int radius, int health, RobotContainer theContainer)
          This is the constructor used when you want a default battery
AnimateGameElement(Location theLocation, Velocity theVelocity, int radius, int health, RobotContainer theContainer, Battery bat)
          This is the constructor used when you want to specify a battery
 
Method Summary
abstract  void collision(GameElement other)
          This is the abstract method used when a subclass collides with another element
 Battery getBattery()
          Returns the battery that this element uses
 Turret getTurret()
          Returns the turret that this element uses
 
Methods inherited from class lane.sente.GameElement
acceptDammage, getHealth, getLocation, getRadius, getVelocity, isCollision, setHealth, setLocation, setRadius, updateListeners, xCollision, yCollision, zCollision
 
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, run, 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

theBattery

protected Battery theBattery

theTurret

protected Turret theTurret
Constructor Detail

AnimateGameElement

public AnimateGameElement(Location theLocation,
                          Velocity theVelocity,
                          int radius,
                          int health,
                          RobotContainer theContainer)
This is the constructor used when you want a default battery
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

AnimateGameElement

public AnimateGameElement(Location theLocation,
                          Velocity theVelocity,
                          int radius,
                          int health,
                          RobotContainer theContainer,
                          Battery bat)
This is the constructor used when you want to specify a battery
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
bat - The battery to be used by this element
Method Detail

getBattery

public Battery getBattery()
Returns the battery that this element uses
Returns:
the battery used by this element

getTurret

public Turret getTurret()
Returns the turret that this element uses
Returns:
the turret used by this element

collision

public abstract void collision(GameElement other)
This is the abstract method used when a subclass collides with another element
Overrides:
collision in class GameElement
Parameters:
The - element that is collided with