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 | Static Public Member Functions | List of all members
rcsc::RoleType Class Reference

player's role type information class More...

#include <role_type.h>

Public Types

enum  Type {
  Goalie = 0 , Defender , MidFielder , Forward ,
  Unknown
}
 role type
 
enum  Side { Center = 0 , Left = -1 , Right = 1 }
 position type (y position)
 

Public Member Functions

 RoleType ()
 default constructor
 
 RoleType (const Type t, const Side s)
 create with given values More...
 
void setType (Type t)
 set the role type More...
 
void setSide (Side s)
 set the side type More...
 
Type type () const
 get the role type More...
 
Side side () const
 get the side type More...
 
bool isGoalie () const
 check if goalie type or not More...
 
bool isDefender () const
 check if defender type or not More...
 
bool isMidFielder () const
 check if midfielder type or not More...
 
bool isForward () const
 check if forward type or not More...
 
bool isCenter () const
 check if center type or not More...
 
bool isLeft () const
 check if left type or not More...
 
bool isRight () const
 check if right type or not More...
 

Static Public Member Functions

static std::string to_string (const Type t)
 create a string value corresponding to the given role type More...
 
static std::string to_string (const Side s)
 create a string value corresponding to the given side type More...
 
static Type to_type (const std::string &str)
 create a role type value from the given string. More...
 
static Side to_side (const std::string &str)
 create a side type value from the given string. More...
 

Detailed Description

player's role type information class

Constructor & Destructor Documentation

◆ RoleType()

rcsc::RoleType::RoleType ( const Type  t,
const Side  s 
)
inline

create with given values

Parameters
trole type value
sside type value

Member Function Documentation

◆ isCenter()

bool rcsc::RoleType::isCenter ( ) const
inline

check if center type or not

Returns
true if center type

◆ isDefender()

bool rcsc::RoleType::isDefender ( ) const
inline

check if defender type or not

Returns
true if defender

◆ isForward()

bool rcsc::RoleType::isForward ( ) const
inline

check if forward type or not

Returns
true if forward

◆ isGoalie()

bool rcsc::RoleType::isGoalie ( ) const
inline

check if goalie type or not

Returns
true if goalie

◆ isLeft()

bool rcsc::RoleType::isLeft ( ) const
inline

check if left type or not

Returns
true if left type

◆ isMidFielder()

bool rcsc::RoleType::isMidFielder ( ) const
inline

check if midfielder type or not

Returns
true if midfielder

◆ isRight()

bool rcsc::RoleType::isRight ( ) const
inline

check if right type or not

Returns
true if right type

◆ setSide()

void rcsc::RoleType::setSide ( Side  s)
inline

set the side type

Parameters
tside type value

◆ setType()

void rcsc::RoleType::setType ( Type  t)
inline

set the role type

Parameters
trole type value

◆ side()

Side rcsc::RoleType::side ( ) const
inline

get the side type

Returns
side type value

◆ to_side()

static Side rcsc::RoleType::to_side ( const std::string &  str)
static

create a side type value from the given string.

Returns
role type value. Center for unsupported values

◆ to_string() [1/2]

static std::string rcsc::RoleType::to_string ( const Side  s)
static

create a string value corresponding to the given side type

Returns
string value

◆ to_string() [2/2]

static std::string rcsc::RoleType::to_string ( const Type  t)
static

create a string value corresponding to the given role type

Returns
string value

◆ to_type()

static Type rcsc::RoleType::to_type ( const std::string &  str)
static

create a role type value from the given string.

Returns
role type value. Unknown for unsupported values

◆ type()

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

get the role type

Returns
role type value

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