#include <SoccerTypes.h>
Definition at line 583 of file SoccerTypes.h.
SoccerCommand::SoccerCommand | ( | CommandT | com = CMD_ILLEGAL , |
|
double | d1 = UnknownDoubleValue , |
|||
double | d2 = UnknownDoubleValue , |
|||
double | d3 = UnknownDoubleValue | |||
) |
This is a constructor for the SoccerCommand class. It creates a command using the passed arguments (with all default illegal values). Depending on the specified CommandT the parameters are used in different ways. See the method makeCommand for an explanation of these values.
com | commandType for this SoccerCommand | |
d1 | 1st argument, meaning depends on com (default UnknownDoubleValue) | |
d2 | 2nd argument, meaning depends on com (default UnknownDoubleValue) | |
d3 | 3rd argument, meaning depends on com (default UnknownDoubleValue) |
Definition at line 462 of file SoccerTypes.cpp.
References CMD_CHANGEVIEW, CMD_SAY, commandType, dAngle, dPower, iTimes, makeCommand(), str, UnknownDoubleValue, va, VA_ILLEGAL, vq, and VQ_ILLEGAL.
SoccerCommand::SoccerCommand | ( | CommandT | com, | |
char * | msg | |||
) |
This is a constructor for the SoccerCommand when the commandType is a say message.
com | commandType for this SoccerCommand (must be CMD_SAY). | |
msg | message for this SoccerCommand |
Definition at line 482 of file SoccerTypes.cpp.
References makeCommand().
bool SoccerCommand::makeCatchCommand | ( | char * | str | ) | [private] |
This method makes a catch command from a SoccerCommand and puts the result in str. Resulting string looks like: (catch dAngle). Enough space should be allocated for str.
command | SoccerCommand that is a catch command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 676 of file SoccerTypes.cpp.
References dAngle, ServerSettings::getMaxMoment(), ServerSettings::getMinMoment(), and SS.
Referenced by getCommandString().
bool SoccerCommand::makeChangeViewCommand | ( | char * | str | ) | [private] |
This method makes a change view command from a SoccerCommand and puts the result in str. Resulting string looks like: (change_view va vq). Enough space should be allocated for str.
command | SoccerCommand that is a change view command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 695 of file SoccerTypes.cpp.
References SoccerTypes::getViewAngleStr(), SoccerTypes::getViewQualityStr(), va, VA_ILLEGAL, vq, and VQ_ILLEGAL.
Referenced by getCommandString().
bool SoccerCommand::makeDashCommand | ( | char * | str | ) | [private] |
This method makes a dash command from a SoccerCommand and puts the result in str. Resulting string looks like: (dash dPower). Enough space should be allocated for str.
command | SoccerCommand that is a dash command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 717 of file SoccerTypes.cpp.
References dPower, ServerSettings::getMaxPower(), ServerSettings::getMinPower(), and SS.
Referenced by getCommandString().
bool SoccerCommand::makeKickCommand | ( | char * | str | ) | [private] |
This method makes a kick command from a SoccerCommand and puts the result in str. Resulting string looks like: (kick dPower dAngle). Enough space should be allocated for str.
command | SoccerCommand that is a kick command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 739 of file SoccerTypes.cpp.
References dAngle, dPower, ServerSettings::getMaxMoment(), ServerSettings::getMaxPower(), ServerSettings::getMinMoment(), ServerSettings::getMinPower(), and SS.
Referenced by getCommandString().
bool SoccerCommand::makeMoveCommand | ( | char * | str | ) | [private] |
This method makes a move command from a SoccerCommand and puts the result in str. Resulting string looks like: (move dX dY). Enough space should be allocated for str.
command | SoccerCommand that is a move command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 760 of file SoccerTypes.cpp.
References dX, dY, PITCH_LENGTH, PITCH_MARGIN, and PITCH_WIDTH.
Referenced by getCommandString().
bool SoccerCommand::makeSayCommand | ( | char * | str_com | ) | [private] |
This method makes a say command from a SoccerCommand and puts the result in str. Resulting string looks like: (say str). Enough space should be allocated for str.
command | SoccerCommand that is a say command | |
str_com | string that will be filled with corresponding SoccerCommand |
Definition at line 783 of file SoccerTypes.cpp.
References str.
Referenced by getCommandString().
bool SoccerCommand::makeSenseBodyCommand | ( | char * | str | ) | [private] |
This method makes a sense_body command from a SoccerCommand and puts the result in str. Resulting string looks like: (sense_body). Enough space should be allocated for str.
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 800 of file SoccerTypes.cpp.
Referenced by getCommandString().
bool SoccerCommand::makeTurnCommand | ( | char * | str | ) | [private] |
This method makes a turn command from a SoccerCommand and puts the result in str. Resulting string looks like: (turn dAngle). Enough space should be allocated for str.
command | SoccerCommand that is a turn command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 812 of file SoccerTypes.cpp.
References dAngle, ServerSettings::getMaxMoment(), ServerSettings::getMinMoment(), and SS.
Referenced by getCommandString().
bool SoccerCommand::makeTurnNeckCommand | ( | char * | str | ) | [private] |
This method makes a turn_neck command from a SoccerCommand and puts the result in str. Resulting string looks like: (turn_neck dAngle). Enough space should be allocated for str.
command | SoccerCommand that is a turn_neck command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 834 of file SoccerTypes.cpp.
References dAngle, ServerSettings::getMaxNeckMoment(), ServerSettings::getMinNeckMoment(), and SS.
Referenced by getCommandString().
bool SoccerCommand::makeChangePlayerCommand | ( | char * | str | ) | [private] |
This method makes a change_player_type command from a SoccerCommand and puts the result in str. Resulting string looks like: (change_player_type dX dY). Where dX stands for the teammate that should be changed and dY for the heterogenous player that it should become. Enough space should be allocated for str.
command | SoccerCommand that is a turn_neck command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 860 of file SoccerTypes.cpp.
References dX, dY, MAX_HETERO_PLAYERS, and MAX_TEAMMATES.
Referenced by getCommandString().
bool SoccerCommand::makeAttentionToCommand | ( | char * | str | ) | [private] |
This method makes a attentionto command from a SoccerCommand and puts the result in str. Resulting string looks like: (attentionto opp|our dY). Where 'opp' is used when dX < 0 and 'our' otherwise. dY stands for the player number of the team we want to pay attention to. When dY equals -1.0 the command (attentionto off) is created. Enough space should be allocated for str.
command | SoccerCommand that is a attentionto command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 885 of file SoccerTypes.cpp.
References dX, dY, and MAX_TEAMMATES.
Referenced by getCommandString().
bool SoccerCommand::makeTackleCommand | ( | char * | str | ) | [private] |
This method makes a tackle command from a SoccerCommand and puts the result in str. Resulting string looks like: (tackle dPower). Enough space should be allocated for str.
command | SoccerCommand that is a tackle command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 917 of file SoccerTypes.cpp.
References dPower, ServerSettings::getMaxPower(), ServerSettings::getMinPower(), and SS.
Referenced by getCommandString().
bool SoccerCommand::makePointToCommand | ( | char * | str | ) | [private] |
This method makes a pointto command from a SoccerCommand and puts the result in str. Resulting string looks like: (pointto dist dir | off)). When dX is smaller than -1.0 the command (pointto off) is created. Enough space should be allocated for str.
command | SoccerCommand that is a pointto command | |
str | string that will be filled with the corresponding SoccerCommand |
Definition at line 939 of file SoccerTypes.cpp.
References dX, dY, ServerSettings::getMaxMoment(), ServerSettings::getMinMoment(), and SS.
Referenced by getCommandString().
void SoccerCommand::makeCommand | ( | CommandT | com, | |
double | d1 = UnknownDoubleValue , |
|||
double | d2 = UnknownDoubleValue , |
|||
double | d3 = UnknownDoubleValue | |||
) |
This method create a SoccerCommand from the specified command type and the parameters. The parameters have a different meaning depending on the given command type. Not all command types are listed, since the other command types need different parameters. So see the other overloaded methods for that.
com | command type specifying the kind of command | |
d1 | meaning depends on the specified command type (see above) | |
d2 | meaning depends on the specified command type (see above) | |
d3 | meaning depends on the specified command type (see above) |
Definition at line 505 of file SoccerTypes.cpp.
References CMD_ATTENTIONTO, CMD_CATCH, CMD_CHANGEPLAYER, CMD_DASH, CMD_KICK, CMD_MOVE, CMD_POINTTO, CMD_TACKLE, CMD_TURN, CMD_TURNNECK, commandType, dAngle, dPower, dX, dY, and UnknownDoubleValue.
Referenced by BasicPlayer::adjustView(), Player::deMeer5_goalie(), Player::executeStringCommand(), SoccerCommand(), and BasicCoach::substitutePlayer().
void SoccerCommand::makeCommand | ( | CommandT | com, | |
ViewAngleT | v, | |||
ViewQualityT | q | |||
) |
This method creates a SoccerCommand for the command type CMD_CHANGEVIEW.
com | command type specifying the kind of command | |
v | view angle for the change view command | |
q | view quality for the change view command |
Definition at line 548 of file SoccerTypes.cpp.
References CMD_CHANGEVIEW, commandType, va, and vq.
void SoccerCommand::makeCommand | ( | CommandT | com, | |
char * | msg | |||
) |
This method creates a command for the command type CMD_SAY that accepts a string as parameter.
com | command type specifying the kind of command. | |
msg | string message that is added to the say message. |
Definition at line 562 of file SoccerTypes.cpp.
References CMD_SAY, commandType, and str.
bool SoccerCommand::isIllegal | ( | ) |
This method returns whether this SoccerCommand is illegal, that is the SoccerCommand hasn't been filled yet. This means that no command would be performed when this command is sent to the server.
Definition at line 626 of file SoccerTypes.cpp.
References CMD_ILLEGAL, and commandType.
Referenced by BasicPlayer::interceptClose(), BasicPlayer::interceptScoringAttempt(), Player::performPenalty(), WorldModel::predictCommandToInterceptBall(), WorldModel::predictCommandToMoveToPos(), BasicPlayer::turnWithBallTo(), and WorldModel::updateAll().
void SoccerCommand::show | ( | ostream & | os | ) |
This method prints the current command to the specified output stream.
os | output stream to which information is printed. |
Definition at line 571 of file SoccerTypes.cpp.
References CMD_ATTENTIONTO, CMD_CATCH, CMD_CHANGEPLAYER, CMD_DASH, CMD_ILLEGAL, CMD_KICK, CMD_MOVE, CMD_POINTTO, CMD_SAY, CMD_SENSEBODY, CMD_TACKLE, CMD_TURN, CMD_TURNNECK, commandType, dAngle, dPower, dX, dY, and str.
bool SoccerCommand::getCommandString | ( | char * | str, | |
ServerSettings * | ss | |||
) |
This method returns a command string that is understood by the server from a SoccerCommand. The resulting string is put in the second argument and returned by the method. A reference to ServerSettings is passed as the second argument to check whether the values in the SoccerCommand are legal.
str | resulting string (enough space for MAX_MSG should be allocated) | |
ss | reference to serversettings class. |
Definition at line 640 of file SoccerTypes.cpp.
References CMD_ATTENTIONTO, CMD_CATCH, CMD_CHANGEPLAYER, CMD_CHANGEVIEW, CMD_DASH, CMD_ILLEGAL, CMD_KICK, CMD_MOVE, CMD_POINTTO, CMD_SAY, CMD_SENSEBODY, CMD_TACKLE, CMD_TURN, CMD_TURNNECK, commandType, makeAttentionToCommand(), makeCatchCommand(), makeChangePlayerCommand(), makeChangeViewCommand(), makeDashCommand(), makeKickCommand(), makeMoveCommand(), makePointToCommand(), makeSayCommand(), makeSenseBodyCommand(), makeTackleCommand(), makeTurnCommand(), makeTurnNeckCommand(), and SS.
Referenced by ActHandler::sendCommand(), ActHandler::sendCommandDirect(), and ActHandler::sendCommands().
ServerSettings* SoccerCommand::SS [private] |
ServerSettings are used to check ranges of command
Definition at line 585 of file SoccerTypes.h.
Referenced by getCommandString(), makeCatchCommand(), makeDashCommand(), makeKickCommand(), makePointToCommand(), makeTackleCommand(), makeTurnCommand(), and makeTurnNeckCommand().
command time, will be set by worldmodel
Definition at line 607 of file SoccerTypes.h.
Referenced by WorldModel::updateAgentAndBallAfterSense().
type of this command
Definition at line 608 of file SoccerTypes.h.
Referenced by Player::deMeer5(), Player::deMeer5_goalie(), ActHandler::emptyQueue(), Player::executeStringCommand(), getCommandString(), BasicPlayer::intercept(), BasicPlayer::interceptClose(), WorldModel::isCollisionAfterCommand(), isIllegal(), ActHandler::isQueueEmpty(), makeCommand(), Player::performPenalty(), WorldModel::predictBallInfoAfterCommand(), WorldModel::predictCommandToInterceptBall(), WorldModel::predictNrCyclesToPoint(), WorldModel::predictStateAfterCommand(), ActHandler::putCommandInQueue(), Player::sayBallStatus(), ActHandler::sendCommandDirect(), ActHandler::sendCommands(), show(), and SoccerCommand().
double SoccerCommand::dAngle |
angle of this command (for turn,turn_neck)
Definition at line 609 of file SoccerTypes.h.
Referenced by Player::executeStringCommand(), makeCatchCommand(), makeCommand(), makeKickCommand(), makeTurnCommand(), makeTurnNeckCommand(), WorldModel::predictBallInfoAfterCommand(), WorldModel::predictCommandTurnTowards(), WorldModel::predictStateAfterCommand(), show(), and SoccerCommand().
double SoccerCommand::dPower |
power of this command (for kick,dash)
Definition at line 610 of file SoccerTypes.h.
Referenced by BasicPlayer::collideWithBall(), Player::deMeer5(), BasicPlayer::dribble(), Player::executeStringCommand(), makeCommand(), makeDashCommand(), makeKickCommand(), makeTackleCommand(), Player::performPenalty(), WorldModel::predictBallInfoAfterCommand(), WorldModel::predictNrCyclesToPoint(), WorldModel::predictStateAfterCommand(), show(), and SoccerCommand().
view quality (for change_view)
Definition at line 611 of file SoccerTypes.h.
Referenced by Player::executeStringCommand(), makeChangeViewCommand(), makeCommand(), SoccerCommand(), and WorldModel::updateAll().
view angle (for change_view)
Definition at line 612 of file SoccerTypes.h.
Referenced by Player::executeStringCommand(), makeChangeViewCommand(), makeCommand(), SoccerCommand(), and WorldModel::updateAll().
double SoccerCommand::dX |
x coordinate (for move)
Definition at line 613 of file SoccerTypes.h.
Referenced by Player::executeStringCommand(), makeAttentionToCommand(), makeChangePlayerCommand(), makeCommand(), makeMoveCommand(), makePointToCommand(), WorldModel::predictStateAfterCommand(), and show().
double SoccerCommand::dY |
y coordinate (for move)
Definition at line 614 of file SoccerTypes.h.
Referenced by Player::executeStringCommand(), makeAttentionToCommand(), makeChangePlayerCommand(), makeCommand(), makeMoveCommand(), makePointToCommand(), WorldModel::predictStateAfterCommand(), and show().
char SoccerCommand::str[MAX_SAY_MSG] |
str (for say)
Definition at line 615 of file SoccerTypes.h.
Referenced by Player::executeStringCommand(), makeCommand(), makeSayCommand(), show(), and SoccerCommand().
how many cycles will a command be sent
Definition at line 616 of file SoccerTypes.h.
Referenced by Player::executeStringCommand(), ActHandler::sendCommands(), and SoccerCommand().