Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Player Class Reference

A class that represents the team color and player number of the robot. More...

`#include <Player.h>`

List of all members.

## Public Types
enum | teamColor { red, blue, undefinedTeamColor }
| possible team colors More...
enum | playerNumber { one = 0, two, three, four, undefinedPlayerNumber, numOfPlayerNumbers = undefinedPlayerNumber }
| the possible player numbers More...
## Public Member Functions
| Player ()
| Constructor.
void | load ()
| Loads the data from player.cfg.
teamColor | getTeamColor () const
| returns the team color
void | setTeamColor (teamColor t)
| sets the team color
char * | getTeamName ()
int | getGameControllerTeamNumber ()
playerNumber | getPlayerNumber () const
| returns the player number
void | setPlayerNumber (playerNumber n)
| sets the player number
## Static Public Member Functions
const char * | getTeamColorName (teamColor color)
| returns the name of a color
teamColor | getTeamColorFromString (char *name)
| returns the color for a given name
const char * | getPlayerNumberName (playerNumber number)
| returns the name of a number
playerNumber | getPlayerNumberFromString (char *name)
| returns the number for a given name
## Private Attributes
teamColor | theTeamColor
| the team color of the player
playerNumber | thePlayerNumber
| the number of the player
char | theTeamName [16]
| the team-name of the player
int | theGameControllerTeamNumber
| the Game-Controller-Team-Number of the Robot

## Detailed Description

A class that represents the team color and player number of the robot.

Author:
  Martin Lötzsch

Definition at line 34 of file Player.h.

## Member Enumeration Documentation

enum Player::teamColor

  | possible team colors Enumeration values:
  red |
  blue |
  undefinedTeamColor |
Definition at line 44 of file Player.h.

enum Player::playerNumber

  | the possible player numbers Enumeration values:
  one |
  two |
  three |
  four |
  undefinedPlayerNumber |
  numOfPlayerNumbers |
Definition at line 81 of file Player.h.

## Constructor & Destructor Documentation

Player::Player | ( |  | ) |

| Constructor. Definition at line 47 of file Player.cpp. References thePlayerNumber, theTeamColor, undefinedPlayerNumber, and undefinedTeamColor.

## Member Function Documentation

void Player::load | ( |  | ) |

| Loads the data from player.cfg. Definition at line 53 of file Player.cpp. References ASSERT, InStream< InFile, InConfig >::eof(), InFile::exists(), four, getPlayerNumberFromString(), getTeamColorFromString(), getTeamColorName(), one, theGameControllerTeamNumber, thePlayerNumber, theTeamColor, theTeamName, three, and two. Referenced by Process::Process().

Here is the call graph for this function:

const char* Player::getTeamColorName | ( | teamColor | color | ) | `[inline, static]`

| returns the name of a color Definition at line 47 of file Player.h. Referenced by load().

teamColor Player::getTeamColor | ( |  | ) | const`[inline]`

| returns the team color Definition at line 58 of file Player.h. References theTeamColor. Referenced by LandmarksPercept::addGoal(), ChallengeSymbols::ChallengeSymbols(), GT2005ObstaclesLocator::determineSeenGoals(), SlamSelfLocator::execute(), GTCamSelfLocator::execute(), GT2005StableSelfLocator::execute(), GT2005SelfLocator::execute(), GTCamPlayersLocator::execute(), GTCamObstaclesLocator::execute(), SlamGoalRecognizer::execute(), GT2004SelfLocator::generatePoseTemplates(), SlamSampleTemplateGenerator::generateTemplates(), GT2005StableSampleTemplateGenerator::generateTemplates(), VLCFlagSpecialist::getFlagPercept(), SlamFlagSpecialist::getFlagPercept(), GT2005FlagSpecialist::getFlagPercept(), GoalRecognizer::getGoalPercept(), RoboCupGameManagerSymbols::getTeamColor(), GameRules::getThrowInPoint(), GameRules::getThrowInPointNumber(), GT2005WalkCalibrationMainBehavior::Initialize(), LandmarksState::initLandmarks(), GT2005SelfLocator::lineObservationUpdate(), DDPHandler::onReceive(), GT2005BehaviorControl::postExecute(), VLCImageProcessor::scan(), SlamImageProcessor::scan(), GT2005ImageProcessor::scan(), GoalRecognizer::scanLinesForGoals(), DDPHandler::sendDDPPackage(), GT2005BallLocator::setBallSymbols(), ObstaclesPercept::setFreePartOfGoal(), MessageQueue::setPlayerForNewMessages(), and GT2004SelfLocator::updateByPoint().

void Player::setTeamColor | ( | teamColor | t | ) | `[inline]`

| sets the team color Definition at line 61 of file Player.h. References theTeamColor. Referenced by RoboCupGameManagerSymbols::setTeamColor(), and RoboCupGameManagerSymbols::update().

teamColor Player::getTeamColorFromString | ( | char * | name | ) | `[inline, static]`

| returns the color for a given name Definition at line 64 of file Player.h. References undefinedTeamColor. Referenced by load().

const char* Player::getPlayerNumberName | ( | playerNumber | number | ) | `[inline, static]`

| returns the name of a number Definition at line 91 of file Player.h. References four, one, three, and two.

char* Player::getTeamName | ( |  | ) | `[inline]`

| Definition at line 106 of file Player.h. References theTeamName.

int Player::getGameControllerTeamNumber | ( |  | ) | `[inline]`

| Definition at line 111 of file Player.h. References theGameControllerTeamNumber. Referenced by GameControlData::getOpponentTeamNumber(), GameControlData::getOwnTeamNumber(), and operator>>().

playerNumber Player::getPlayerNumber | ( |  | ) | const`[inline]`

| returns the player number Definition at line 117 of file Player.h. References thePlayerNumber. Referenced by GT2005ConfigurationSymbols::computeKickoffRole(), GT2005StrategySymbols::computeRole(), GT2005StrategySymbols::estimateTimeToReachBall(), GT2005TeamBallLocator::execute(), GTCamSelfLocator::execute(), GTCamPlayersLocator::execute(), GTCamObstaclesLocator::execute(), GT2005ConfigurationSymbols::getOpponentKickoffAngle(), GT2005ConfigurationSymbols::getOpponentKickoffX(), GT2005ConfigurationSymbols::getOpponentKickoffY(), GT2005ConfigurationSymbols::getOwnKickoffAngle(), GT2005ConfigurationSymbols::getOwnKickoffX(), GT2005ConfigurationSymbols::getOwnKickoffY(), GameControlData::getRobot(), GT2005StrategySymbols::getRobotNumber(), GT2005StrategySymbols::getSearchBallX(), GT2005ConfigurationSymbols::GT2005ConfigurationSymbols(), GT2005WalkCalibrationMainBehavior::Initialize(), DDPHandler::onReceive(), operator<<(), GT2005BehaviorControl::postExecute(), TeamMessageCollection::processTimeStamps(), DDPHandler::sendDDPPackage(), GT2005ObstaclesLocator::setObstaclesModel(), MessageQueue::setPlayerForNewMessages(), UDPHandler::start(), and GTCamTimeSyncHandler::startTimeSync().

void Player::setPlayerNumber | ( | playerNumber | n | ) | `[inline]`

| sets the player number Definition at line 120 of file Player.h. References thePlayerNumber.

playerNumber Player::getPlayerNumberFromString | ( | char * | name | ) | `[inline, static]`

| returns the number for a given name Definition at line 123 of file Player.h. References four, one, three, two, and undefinedPlayerNumber. Referenced by load().

## Member Data Documentation

teamColor Player::theTeamColor`[private]`

| the team color of the player Definition at line 137 of file Player.h. Referenced by getTeamColor(), load(), Player(), and setTeamColor().

playerNumber Player::thePlayerNumber`[private]`

| the number of the player Definition at line 140 of file Player.h. Referenced by getPlayerNumber(), load(), Player(), and setPlayerNumber().

char Player::theTeamName[16]`[private]`

| the team-name of the player Definition at line 143 of file Player.h. Referenced by getTeamName(), and load().

int Player::theGameControllerTeamNumber`[private]`

| the Game-Controller-Team-Number of the Robot Definition at line 146 of file Player.h. Referenced by getGameControllerTeamNumber(), and load().

The documentation for this class was generated from the following files:

- Tools/Player.h
- Tools/Player.cpp
- Modules/BehaviorControl/CommonXabsl2Symbols/GtCamSymbols.cpp