PlayerTypeInfo Class Reference

#include <Formations.h>


Public Member Functions

 PlayerTypeInfo ()
 PlayerTypeInfo (PlayerT, double, double, double, double, bool)
bool setValues (PlayerT, double, double, double, double, bool)
void show (ostream &os=cout)
bool setPlayerType (PlayerT type)
PlayerT getPlayerType () const
bool setAttrX (double attrX)
double getAttrX () const
bool setAttrY (double attrY)
double getAttrY () const
bool setMinX (double minX)
double getMinX () const
bool setMaxX (double maxX)
double getMaxX () const
bool setBehindBall (bool b)
bool getBehindBall () const

Private Attributes

PlayerT playerType
double dAttrX
double dAttrY
double dMinX
double dMaxX
bool bBehindBall


Detailed Description

This class contains information for one individual player_type, defined in SoccerTypes.h. A player_type should not be confused with the player_types introduced in soccerserver 7.xx. A playerType PlayerT is defined as the kind of a player. Different possibilities are PT_ATTACKER, PT_MIDFIELDER_WING, etc. This class contains different characteristics of one playertype. This information consists of the following values:

This class contains different get and set methods to change the values associated for this class, normally these are changed when the Formations class reads in the formation file.

Definition at line 94 of file Formations.h.


Constructor & Destructor Documentation

PlayerTypeInfo::PlayerTypeInfo (  ) 

This method is the default constructor and sets all the values of this class to "illegal" values. This method is needed when an array of this class is initialized, since then the default constructor (without arguments) is called. Afterwards the actual values should be set using the method setValues.

Definition at line 64 of file Formations.cpp.

References PT_ILLEGAL, setValues(), and UnknownDoubleValue.

PlayerTypeInfo::PlayerTypeInfo ( PlayerT  pt,
double  dAttrX,
double  dAttrY,
double  dMinX,
double  dMaxX,
bool  bBehindBall 
)

This Constructor receives the values for all the member variables as arguments and initializes the member variables using the method setValues.

Parameters:
pt PlayerType corresponding to the player type of this class
dAttrX x attraction to the ball
dAttrY y attraction to the ball
dMinX minimal x coordinate for this player type
dMaxX maximal x coordinate for this player type
bBehindBall boolean indicating whether this player type should always stay behind the ball.

Definition at line 79 of file Formations.cpp.

References setValues().


Member Function Documentation

bool PlayerTypeInfo::setValues ( PlayerT  pt,
double  ax,
double  ay,
double  minx,
double  maxx,
bool  bb 
)

This method receives the values for all the member variables as arguments and sets these member variables.

Parameters:
pt PlayerType corresponding to the player type of this class
ax x attraction to the ball
ay y attraction to the ball
minx minimal x coordinate for this player type
maxx maximal x coordinate for this player type
bb boolean indicating whether this player type should always stay behind the ball.
Returns:
bool indicating whether update was successful.

Definition at line 95 of file Formations.cpp.

References bBehindBall, dAttrX, dAttrY, dMaxX, dMinX, and playerType.

Referenced by PlayerTypeInfo().

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

This method print the different member values separated by comma's to the specified output stream.

Parameters:
os output stream to which member values are printed

Definition at line 111 of file Formations.cpp.

References bBehindBall, dAttrX, dAttrY, dMaxX, dMinX, and playerType.

bool PlayerTypeInfo::setPlayerType ( PlayerT  type  ) 

This method sets the player type associated with this class.

Parameters:
type new player type
Returns:
bool indicating whether update was succesfull

Definition at line 122 of file Formations.cpp.

References playerType.

PlayerT PlayerTypeInfo::getPlayerType (  )  const

This method returns the player type associated with this class.

Returns:
player type of this class

Definition at line 130 of file Formations.cpp.

References playerType.

bool PlayerTypeInfo::setAttrX ( double  dAttractionX  ) 

This method sets the x attraction to the ball for this player type. The x attraction to the ball is a double in the range (0,1). This value is used to determine the x coordinate of the strategic position for this player type. The x attraction of the ball is multiplied with the x coordinate of the ball and added to the home position of the agent to determine the x coordinate of the strategic position.

Parameters:
dAttractionX new x attraction for this player type
Returns:
bool indicating whether update was succesfull

Definition at line 143 of file Formations.cpp.

References dAttrX.

Referenced by Formations::readFormations().

double PlayerTypeInfo::getAttrX (  )  const

This method returns the x attraction to the ball for this player type. The x attraction to the ball is a double in the range (0,1). This value is used to determine the x coordinate of the strategic position for this player type. The x attraction of the ball is multiplied with the x coordinate of the ball and added to the home position of the agent to determine the x coordinate of the strategic position.

Returns:
x attraction for this player type

Definition at line 156 of file Formations.cpp.

References dAttrX.

Referenced by Formations::getStrategicPosition().

bool PlayerTypeInfo::setAttrY ( double  dAttractionY  ) 

This method sets the y attraction to the ball for this player type. The y attraction to the ball is a double in the range (0,1). This value is used to determine the y coordinate of the strategic position for this player type. The y attraction of the ball is multiplied with the y coordinate of the ball and added to the home position of the agent to determine the y coordinate of the strategic position.

Parameters:
dAttractionY new y attraction for this player type
Returns:
bool indicating whether update was succesfull

Definition at line 169 of file Formations.cpp.

References dAttrY.

Referenced by Formations::readFormations().

double PlayerTypeInfo::getAttrY (  )  const

This method returns the y attraction to the ball for this player type. The y attraction to the ball is a double in the range (0,1). This value is used to determine the y coordinate of the strategic position for this player type. The y attraction of the ball is multiplied with the y coordinate of the ball and added to the home position of the agent to determine the y coordinate of the strategic position.

Returns:
y attraction for this player type

Definition at line 182 of file Formations.cpp.

References dAttrY.

Referenced by Formations::getStrategicPosition().

bool PlayerTypeInfo::setMinX ( double  dMinimalX  ) 

This method sets the minimal x coordinate for this player type. When the calculated x coordinate for the strategic position is lower than this value, the x coordinate is set to this minimal x coordinate.

Parameters:
dMinimalX new minimal x coordinate for this player type
Returns:
bool indicating whether update was succesfull.

Definition at line 192 of file Formations.cpp.

References dMinX.

Referenced by Formations::readFormations().

double PlayerTypeInfo::getMinX (  )  const

This method returns the minimal x coordinate for this player type. When the calculated x coordinate for the strategic position is lower than this value, the x coordinate is set to this minimal x coordinate.

Returns:
minimal x coordinate for this player type

Definition at line 202 of file Formations.cpp.

References dMinX.

Referenced by Formations::getStrategicPosition().

bool PlayerTypeInfo::setMaxX ( double  dMaximalX  ) 

This method sets the maximal x coordinate for this player type. When the calculated x coordinate for the strategic position is larger than this value, the x coordinate is set to this maximal x coordinate.

Parameters:
dMaximalX new maximal x coordinate for this player type
Returns:
bool indicating whether update was succesfull.

Definition at line 212 of file Formations.cpp.

References dMaxX.

Referenced by Formations::readFormations().

double PlayerTypeInfo::getMaxX (  )  const

This method returns the maximal x coordinate for this player type. When the calculated x coordinate for the strategic position is larger than this value, the x coordinate is set to this maximal x coordinate.

Returns:
maximal x coordinate for this player type

Definition at line 222 of file Formations.cpp.

References dMaxX.

Referenced by Formations::getStrategicPosition().

bool PlayerTypeInfo::setBehindBall ( bool  b  ) 

This method sets the value that indicates whether this player type should stay behind the ball or not. When set to true and the strategic position for this player type is calculated to be in front of the ball. The x coordinate of the strategic position is set to the x coordinate of the ball.

Parameters:
b boolean indicating whether this playertype should stay behind the ball
Returns:
bool indicating whether update was succesfull.

Definition at line 234 of file Formations.cpp.

References bBehindBall.

Referenced by Formations::readFormations().

bool PlayerTypeInfo::getBehindBall (  )  const

This method returns the value that indicates whether this player type should stay behind the ball or not. When set to true and the strategic position for this player type is calculated to be in front of the ball. The x coordinate of the strategic position is set to the x coordinate of the ball.

Returns:
bool indicating whether to stay behind the ball or not

Definition at line 246 of file Formations.cpp.

References bBehindBall.

Referenced by Formations::getStrategicPosition().


Field Documentation

PlayerT PlayerTypeInfo::playerType [private]

This class gives information about this PlayerType

Definition at line 96 of file Formations.h.

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

double PlayerTypeInfo::dAttrX [private]

x attraction to the ball

Definition at line 97 of file Formations.h.

Referenced by getAttrX(), setAttrX(), setValues(), and show().

double PlayerTypeInfo::dAttrY [private]

y attraction to the ball

Definition at line 98 of file Formations.h.

Referenced by getAttrY(), setAttrY(), setValues(), and show().

double PlayerTypeInfo::dMinX [private]

minimal x coordinate for this player type

Definition at line 99 of file Formations.h.

Referenced by getMinX(), setMinX(), setValues(), and show().

double PlayerTypeInfo::dMaxX [private]

maximal x coordinate for this player type

Definition at line 100 of file Formations.h.

Referenced by getMaxX(), setMaxX(), setValues(), and show().

bool PlayerTypeInfo::bBehindBall [private]

should player always stay behind the ball

Definition at line 101 of file Formations.h.

Referenced by getBehindBall(), setBehindBall(), setValues(), and show().


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