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.


Field Summary
protected  TwoDVec m_vecStart
          The start position of the player
protected  TwoDVec m_vecZone
          The zone position of the player
 
Constructor Summary
Player(RobocupEnvironment theEnv, DatagramWrapper dg, int nPlayerNum, int nZone)
          The Constructor initializes the zone and playernumber and starts the player thread
 
Method Summary
 void addBehavior(RobocupBehavior rb)
          Adds a behavior to the player
 void removeBehavior(RobocupBehavior rb)
          Removes a behavior from the player
 void run()
          Fires behaviors every 100 ms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_vecStart

protected TwoDVec m_vecStart
The start position of the player

m_vecZone

protected TwoDVec m_vecZone
The zone position of the player
Constructor Detail

Player

public Player(RobocupEnvironment theEnv,
              DatagramWrapper dg,
              int nPlayerNum,
              int nZone)
The Constructor initializes the zone and playernumber and starts the player thread
Method Detail

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