|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
demo.helicopter.Referee
The referee monitors the execution of the simulation. It receives all state PDUs, maintains each entities information, and performs the necessary actions to update the visual simulation. It enforces the rules of the simulation, awarding points as appropriate and reseting the simulation whenever a team return the opposing teams' flag to it's homebase. The Referee directly controls the state of the team flags.
Field Summary |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Referee()
Constructor. |
Method Summary | |
void |
blueReleaseFlag()
Called when the blue flag is released by a 'red' entity |
void |
checkForPickupBlue(EntityStatePdu vehicle)
Determines if the given PDU is from a 'red' entity. |
void |
checkForPickupRed(EntityStatePdu vehicle)
Determines if the given PDu is from a 'blue' entity. |
void |
checkForVictory()
Check to see if either flag is currently taken by the opposing team. |
void |
collectPdus()
Collects the incoming PDUs and performs the appropriate updates |
protected void |
debug(java.lang.String pDiagnostic)
Debugging output routine. |
boolean |
getDEBUG()
Access DEBUG trace variable. |
static void |
main(java.lang.String[] args)
The 'Main' method of the simulation. |
void |
moveBlue(EntityStatePdu vehicle)
Visually updates the current information for any 'blue' entity, based upon the given PDU |
void |
moveRed(EntityStatePdu vehicle)
Visually updates the current information for any 'red' entity, based upon the given PDU |
void |
redReleaseFlag()
Called when the red flag is released by a blue entity |
void |
reset()
Resets the simulation for another run |
void |
run()
Called to begins the Referee thread. |
void |
runAgents(EntityStatePdu pEntityStatePdu)
Keep's track of the non-human controlled agent entities. |
void |
setDEBUG(boolean pDEBUG)
Modify DEBUG trace variable. |
void |
setPlaying(boolean setValue)
Used to toggle the 'playing' boolean. |
void |
startPlaying()
Called to initiate the running of the simulation. |
void |
stopRun()
Terminates the behaviorSreamBuffer |
protected void |
trace(java.lang.String pDiagnostic)
Guaranteed trace output routine. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, 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 |
Constructor Detail |
public Referee()
Method Detail |
public boolean getDEBUG()
public void setDEBUG(boolean pDEBUG)
protected void debug(java.lang.String pDiagnostic)
protected void trace(java.lang.String pDiagnostic)
Can't be static
or all entities look the same.
public void run()
public void setPlaying(boolean setValue)
public void startPlaying()
public void stopRun()
public void reset()
public void redReleaseFlag()
public void blueReleaseFlag()
public void moveRed(EntityStatePdu vehicle)
public void moveBlue(EntityStatePdu vehicle)
public void collectPdus()
public void checkForPickupRed(EntityStatePdu vehicle)
public void checkForPickupBlue(EntityStatePdu vehicle)
public void checkForVictory()
public void runAgents(EntityStatePdu pEntityStatePdu)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |