FormationTypeInfo Class Reference

#include <Formations.h>


Public Member Functions

 FormationTypeInfo ()
void show (ostream &os=cout)
bool setFormationType (FormationT type)
FormationT getFormationType () const
bool setPosHome (VecPosition pos, int atIndex)
bool setXPosHome (double x, int atIndex)
bool setYPosHome (double y, int atIndex)
VecPosition getPosHome (int atIndex) const
bool setPlayerType (PlayerT type, int atIndex)
PlayerT getPlayerType (int atIndex) const
bool setPlayerTypeInfo (PlayerTypeInfo info, int atIndex)
PlayerTypeInfogetPlayerTypeInfo (int atIndex)
PlayerTypeInfogetPlayerTypeInfoOfPlayer (int iPlayerInFormation)

Private Attributes

FormationT formationType
VecPosition posHome [MAX_TEAMMATES]
PlayerT playerType [MAX_TEAMMATES]
PlayerTypeInfo playerTypeInfo [MAX_PLAYER_TYPES]


Detailed Description

This class contains information about one specific formation. It contains the formation type (defined in SoccerTypes.h), the home position of all the roles (=specific player in a formation), the player types for all the roles and the information about the different player_types. Furthermore it contains methods to retrieve this information for a specific role.

Definition at line 138 of file Formations.h.


Constructor & Destructor Documentation

FormationTypeInfo::FormationTypeInfo (  ) 

This is the default constructor and does nothing.

Definition at line 256 of file Formations.cpp.


Member Function Documentation

void FormationTypeInfo::show ( ostream &  os = cout  ) 

This method prints all the information about this formation to the specified output stream. The format is the following:

Definition at line 287 of file Formations.cpp.

References MAX_PLAYER_TYPES, MAX_TEAMMATES, playerType, playerTypeInfo, and posHome.

bool FormationTypeInfo::setFormationType ( FormationT  type  ) 

This method sets the current formation type for this class.

Parameters:
type new formation type for this class.
Returns:
bool indicating whether update was successful.

Definition at line 263 of file Formations.cpp.

References formationType.

FormationT FormationTypeInfo::getFormationType (  )  const

This method return the current formation type for this class.

Returns:
formation type for this class.

Definition at line 271 of file Formations.cpp.

References formationType.

bool FormationTypeInfo::setPosHome ( VecPosition  pos,
int  atIndex 
)

This method sets the home position of the role indicated by the number 'atIndex' in this formation. The home position is the position from which the strategic position is calculated and could be interpreted as the position a player is located when the ball is at the position (0,0).

Parameters:
pos new home position for the player with role number 'atIndex'
atIndex index of the player with role for which the home position should be set.
Returns:
bool indicating whether update was succesfull.

Definition at line 349 of file Formations.cpp.

References posHome.

bool FormationTypeInfo::setXPosHome ( double  x,
int  atIndex 
)

This method sets the x coordinate of the home position for the player with role number 'atIndex'.

Parameters:
x x coordinate for the home position
atIndex role in formation for which x coordinate should be set.
Returns:
bool indicating whether update was succesfull.

Definition at line 360 of file Formations.cpp.

References posHome, and VecPosition::setX().

bool FormationTypeInfo::setYPosHome ( double  y,
int  atIndex 
)

This method sets the y coordinate of the home position for the player with role number 'atIndex'.

Parameters:
y y coordinate for the home position
atIndex role number for which y coordinate should be set.
Returns:
bool indicating whether update was succesfull.

Definition at line 371 of file Formations.cpp.

References posHome, and VecPosition::setY().

VecPosition FormationTypeInfo::getPosHome ( int  atIndex  )  const

This method returns the home position for the player with role number atIndex in this formation. The home position is the position from which the strategic position is calculated and could be interpreted as the position a player is located when the ball is at the position (0,0).

Returns:
home position for player number at index 'atIndex'

Definition at line 382 of file Formations.cpp.

References posHome.

Referenced by Formations::getStrategicPosition().

bool FormationTypeInfo::setPlayerType ( PlayerT  type,
int  atIndex 
)

This method sets the player type for the player with role number 'atIndex' in this formation.

Parameters:
type new player type for role at position 'atIndex'
atIndex role number for which player type should be set.
Returns:
bool indicating whether update was succesfull.

Definition at line 392 of file Formations.cpp.

References playerType.

PlayerT FormationTypeInfo::getPlayerType ( int  atIndex  )  const

This method returns the player type for the player with role number 'atIndex' in this formation.

Returns:
player type for player with role number 'atIndex'

Definition at line 401 of file Formations.cpp.

References playerType.

Referenced by Formations::getPlayerType().

bool FormationTypeInfo::setPlayerTypeInfo ( PlayerTypeInfo  info,
int  atIndex 
)

This method sets the information for a player type in this formation. Note that information is for a player TYPE and not for a player ROLE.

Parameters:
info new player type information for the player type at 'atIndex'.
atIndex number of player type for which information should be set.
Returns:
bool indicating whether update was succesfull.

Definition at line 411 of file Formations.cpp.

References playerTypeInfo.

PlayerTypeInfo * FormationTypeInfo::getPlayerTypeInfo ( int  atIndex  ) 

This method returns (a pointer to) the player type information for the player type at position 'atIndex'

Parameters:
atIndex index of which player type information should be returned
Returns:
pointer to player type information located at index 'atIndex'

Definition at line 421 of file Formations.cpp.

References playerTypeInfo.

PlayerTypeInfo * FormationTypeInfo::getPlayerTypeInfoOfPlayer ( int  iPlayerInFormation  ) 

This method returns (a pointer to) the player type information for the player with role number 'iPlayerInFormation'.

Parameters:
iPlayerInFormation role number for which info should be returned
Returns:
pointer to information for role 'iPlayerInFormation'

Definition at line 431 of file Formations.cpp.

References playerType, and playerTypeInfo.


Field Documentation

FormationT FormationTypeInfo::formationType [private]

type of this formation

Definition at line 140 of file Formations.h.

Referenced by getFormationType(), and setFormationType().

VecPosition FormationTypeInfo::posHome[MAX_TEAMMATES] [private]

home position for roles

Definition at line 141 of file Formations.h.

Referenced by getPosHome(), setPosHome(), setXPosHome(), setYPosHome(), and show().

PlayerT FormationTypeInfo::playerType[MAX_TEAMMATES] [private]

player_types for roles

Definition at line 142 of file Formations.h.

Referenced by getPlayerType(), getPlayerTypeInfoOfPlayer(), setPlayerType(), and show().

PlayerTypeInfo FormationTypeInfo::playerTypeInfo[MAX_PLAYER_TYPES] [private]

info for roles

Definition at line 143 of file Formations.h.

Referenced by getPlayerTypeInfo(), getPlayerTypeInfoOfPlayer(), setPlayerTypeInfo(), and show().


The documentation for this class was generated from the following files:
Generated on Thu Apr 26 22:45:30 2007 for GangOfSix(GOS)-RoboCupTeamProject by  doxygen 1.5.1-p1