LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
rcsc::GameMode Class Reference

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, SideIDPair
 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 &current)
 analyze playmode string and update internal status More...
 
void setScore (const int score_l, const int score_r)
 set scores directly. More...
 
const GameTimetime () 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...
 

Detailed Description

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.

Member Function Documentation

◆ getServerPlayMode()

PlayMode rcsc::GameMode::getServerPlayMode ( ) const

get rcssserver playmode

Returns
rcssserver playmode Id

◆ isGameEndMode()

bool rcsc::GameMode::isGameEndMode ( ) const

check if current playmode is game end type.

Returns
true if game is end

◆ isOurSetPlay()

bool rcsc::GameMode::isOurSetPlay ( const SideID  our_side) const
inline

check if current mode is our setplay

Parameters
our_sideclinet's team side
Returns
true if current playmode is our setplay mode

◆ isPenaltyKickMode()

bool rcsc::GameMode::isPenaltyKickMode ( ) const

check if current playmode is one of penalty kick mode.

Returns
true if game is penalty kick mode

◆ isServerCycleStoppedMode()

bool rcsc::GameMode::isServerCycleStoppedMode ( ) const

check if current playmode is one of server cycle stopped type.

Returns
true if cycle is stopped, false other wise

◆ isTeamsSetPlay()

bool rcsc::GameMode::isTeamsSetPlay ( const SideID  team_side) const

check if current mode is team's setplay

Parameters
team_sidejudged team side id
Returns
true if current playmode is team's setplay mode

◆ isTheirSetPlay()

bool rcsc::GameMode::isTheirSetPlay ( const SideID  our_side) const
inline

check if current mode is their setplay

Parameters
our_sideclinet's team side
Returns
true if current playmode is their setplay mode

◆ print()

std::ostream & rcsc::GameMode::print ( std::ostream &  os) const

print current playmode string to stream

Parameters
osreference to the output stream
Returns
reference to the output stream

◆ scoreLeft()

int rcsc::GameMode::scoreLeft ( ) const
inline

get current left score

Returns
left score value

◆ scoreRight()

int rcsc::GameMode::scoreRight ( ) const
inline

get current right score

Returns
right score value

◆ setScore()

void rcsc::GameMode::setScore ( const int  score_l,
const int  score_r 
)

set scores directly.

Parameters
score_lleft team score
score_rright team score

◆ side()

SideID rcsc::GameMode::side ( ) const
inline

get current playmode side

Returns
playmode side Id

◆ time()

const GameTime & rcsc::GameMode::time ( ) const
inline

get last update time

Returns
const reference to the GameTime object

◆ toCString()

const char * rcsc::GameMode::toCString ( ) const

get playmode string

Returns
const char pointer

◆ type()

Type rcsc::GameMode::type ( ) const
inline

get current playmode type

Returns
client side playmode type Id

◆ update()

bool rcsc::GameMode::update ( const std::string &  mode_str,
const GameTime current 
)

analyze playmode string and update internal status

Parameters
mode_strplaymode string sent from server
currentcurrent game time
Return values
truesuccessfully updated.
falsedetected illegal playmode string

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