|
LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
|
playmode(referee info) wrapper class More...
#include <game_mode.h>
Public Types | |
| enum | Type { BeforeKickOff , TimeOver , PlayOn , KickOff_ , KickIn_ , FreeKick_ , CornerKick_ , GoalKick_ , AfterGoal_ , OffSide_ , PenaltyKick_ , FirstHalfOver , Pause , Human , FoulCharge_ , FoulPush_ , FoulMultipleAttacker_ , FoulBallOut_ , BackPass_ , FreeKickFault_ , CatchFault_ , IndFreeKick_ , PenaltySetup_ , PenaltyReady_ , PenaltyTaken_ , PenaltyMiss_ , PenaltyScore_ , IllegalDefense_ , PenaltyOnfield_ , PenaltyFoul_ , GoalieCatch_ , ExtendHalf , MODE_MAX } |
| playmode type Id | |
| typedef std::pair< Type, SideID > | Pair |
| alias of the pair of playmode type and side type | |
Public Member Functions | |
| GameMode () | |
| init member variables | |
| GameMode (Type type, SideID side, const GameTime &time, int score_left, int score_right) | |
| init member variables with arguments | |
| bool | update (const std::string &mode_str, const GameTime ¤t) |
| analyze playmode string and update internal status More... | |
| void | setScore (const int score_l, const int score_r) |
| set scores directly. More... | |
| const GameTime & | time () const |
| get last update time More... | |
| Type | type () const |
| get current playmode type More... | |
| SideID | side () const |
| get current playmode side More... | |
| int | scoreLeft () const |
| get current left score More... | |
| int | scoreRight () const |
| get current right score More... | |
| bool | isServerCycleStoppedMode () const |
| check if current playmode is one of server cycle stopped type. More... | |
| bool | isGameEndMode () const |
| check if current playmode is game end type. More... | |
| bool | isPenaltyKickMode () const |
| check if current playmode is one of penalty kick mode. More... | |
| bool | isTeamsSetPlay (const SideID team_side) const |
| check if current mode is team's setplay More... | |
| bool | isOurSetPlay (const SideID our_side) const |
| check if current mode is our setplay More... | |
| bool | isTheirSetPlay (const SideID our_side) const |
| check if current mode is their setplay More... | |
| PlayMode | getServerPlayMode () const |
| get rcssserver playmode More... | |
| const char * | toCString () const |
| get playmode string More... | |
| std::ostream & | print (std::ostream &os) const |
| print current playmode string to stream More... | |
playmode(referee info) wrapper class
This class can be updated by server playmode string using update() method. This class can also handle current game score.
| PlayMode rcsc::GameMode::getServerPlayMode | ( | ) | const |
get rcssserver playmode
| bool rcsc::GameMode::isGameEndMode | ( | ) | const |
check if current playmode is game end type.
|
inline |
check if current mode is our setplay
| our_side | clinet's team side |
| bool rcsc::GameMode::isPenaltyKickMode | ( | ) | const |
check if current playmode is one of penalty kick mode.
| bool rcsc::GameMode::isServerCycleStoppedMode | ( | ) | const |
check if current playmode is one of server cycle stopped type.
| bool rcsc::GameMode::isTeamsSetPlay | ( | const SideID | team_side | ) | const |
check if current mode is team's setplay
| team_side | judged team side id |
|
inline |
check if current mode is their setplay
| our_side | clinet's team side |
| std::ostream & rcsc::GameMode::print | ( | std::ostream & | os | ) | const |
print current playmode string to stream
| os | reference to the output stream |
|
inline |
get current left score
|
inline |
get current right score
| void rcsc::GameMode::setScore | ( | const int | score_l, |
| const int | score_r | ||
| ) |
set scores directly.
| score_l | left team score |
| score_r | right team score |
|
inline |
get current playmode side
|
inline |
get last update time
| const char * rcsc::GameMode::toCString | ( | ) | const |
get playmode string
|
inline |
get current playmode type
| bool rcsc::GameMode::update | ( | const std::string & | mode_str, |
| const GameTime & | current | ||
| ) |
analyze playmode string and update internal status
| mode_str | playmode string sent from server |
| current | current game time |
| true | successfully updated. |
| false | detected illegal playmode string |