betir
Class Player
java.lang.Object
|
+--betir.Player
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- Attacker, Goalie, ZonePlayer
- public class Player
- extends java.lang.Object
- implements java.lang.Runnable
This is the base class that runs each player and decides which behavior will fire.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_vecStart
protected TwoDVec m_vecStart
- The start position of the player
m_vecZone
protected TwoDVec m_vecZone
- The zone position of the player
Player
public Player(RobocupEnvironment theEnv,
DatagramWrapper dg,
int nPlayerNum,
int nZone)
- The Constructor initializes the zone and playernumber and starts the player thread
addBehavior
public void addBehavior(RobocupBehavior rb)
- Adds a behavior to the player
- Parameters:
rb
- the behavior to be added
removeBehavior
public void removeBehavior(RobocupBehavior rb)
- Removes a behavior from the player
- Parameters:
rb
- the behavior to be removed
run
public void run()
- Fires behaviors every 100 ms
- Specified by:
run
in interface java.lang.Runnable