#include <gamestateaspect.h>
Inheritance diagram for GameStateAspect:
Public Member Functions | |
GameStateAspect () | |
virtual | ~GameStateAspect () |
virtual void | Update (float deltaTime) |
called during the update of the GameControlServer to allow the ControlAspect to perform any necessary checks. | |
bool | IsFinished () const |
Used by the SexpMonitor to check if the terminating message should be sent. | |
void | Finish () |
finish the simulation | |
TPlayMode | GetPlayMode () const |
returns the current play mode | |
void | SetPlayMode (TPlayMode mode) |
sets the current play mode | |
void | KickOff (TTeamIndex ti=TI_NONE) |
set the current play mode randomly to PM_KickOff_Left or PM_KickOff_Right. | |
TTime | GetTime () const |
returns the current game time | |
TTime | GetModeTime () const |
returns the time passed since the last playmode change | |
TTime | GetLastModeChange () const |
returns the time of the last playmode change | |
void | SetGameHalf (TGameHalf half) |
sets the current game half | |
TGameHalf | GetGameHalf () const |
returns the current game half | |
void | SetTeamName (TTeamIndex idx, const std::string &name) |
sets the name of a team | |
std::string | GetTeamName (TTeamIndex idx) const |
returns the name of a team | |
bool | RequestUniform (boost::shared_ptr< AgentState > agentState, std::string teamName, unsigned int unum) |
called from the InitEffector to request a uniformn number and teamname | |
int | RequestUniformNumber (TTeamIndex ti) const |
returns the next uniform number not taken for the given team | |
salt::Vector3f | RequestInitPosition (const TTeamIndex ti) |
called from the InitEffector to request an initial position for an agent | |
void | ScoreTeam (TTeamIndex idx) |
increments the score of a team | |
int | GetScore (TTeamIndex idx) const |
returns the score of a team | |
Protected Types | |
typedef std::set< int > | TUnumSet |
Protected Member Functions | |
virtual void | OnLink () |
setup the init positions for the agents | |
void | UpdateTime (float deltaTime) |
advances the game time | |
bool | InsertUnum (TTeamIndex idx, int unum) |
checks if the set of uniform numbers of given team already contains a uniform number unum and inserts it. | |
TTeamIndex | GetTeamIndex (const std::string &teamName) |
returns the team index corresponding to the given teamName. | |
Protected Attributes | |
TPlayMode | mPlayMode |
the current play mode | |
TTime | mLastModeChange |
the last time the play mode changed | |
TTime | mTime |
the current game time | |
TTime | mLeadTime |
the current time before the match started | |
TTime | mFupTime |
the time in game state Game Over | |
TGameHalf | mGameHalf |
the current half of the game | |
TTeamIndex | mLastKickOff |
the team that had the last KickOff | |
std::string | mTeamName [2] |
the names of the two teams | |
TUnumSet | mUnumSet [2] |
the set of uniform number for each team | |
int | mMaxUnum [2] |
the maximal uniform number handed out for each team | |
int | mScore [2] |
the scores of two teams | |
salt::Vector3f | mLeftInit |
the position where the last left player was put initially | |
salt::Vector3f | mRightInit |
the position where the last right player was put initially | |
float | mAgentRadius |
the radius of an agent | |
bool | mFinished |
flag if the simulation should be stopped |
Definition at line 30 of file gamestateaspect.h.
|
Definition at line 33 of file gamestateaspect.h. |
|
Definition at line 33 of file gamestateaspect.cpp. References GH_FIRST, mFinished, mFupTime, mGameHalf, mLastKickOff, mLastModeChange, mLeadTime, mLeftInit, mMaxUnum, mPlayMode, mRightInit, mScore, mTime, PM_BeforeKickOff, and TI_NONE. |
|
Definition at line 52 of file gamestateaspect.cpp. |
|
finish the simulation
Definition at line 50 of file gamestateaspect.h. References mFinished. |
|
returns the current game half
Definition at line 323 of file gamestateaspect.cpp. References mGameHalf. |
|
returns the time of the last playmode change
Definition at line 176 of file gamestateaspect.cpp. References mLastModeChange. |
|
returns the time passed since the last playmode change
Definition at line 162 of file gamestateaspect.cpp. References mFupTime, mLastModeChange, mLeadTime, mPlayMode, mTime, PM_BeforeKickOff, and PM_GameOver. |
|
returns the current play mode
Definition at line 79 of file gamestateaspect.cpp. References mPlayMode. |
|
returns the score of a team
Definition at line 344 of file gamestateaspect.cpp. |
|
returns the team index corresponding to the given teamName. If the teamname does not exist and less than two teams are registered, the given team name is registered. Definition at line 211 of file gamestateaspect.cpp. |
|
returns the name of a team
Definition at line 197 of file gamestateaspect.cpp. |
|
returns the current game time
Definition at line 156 of file gamestateaspect.cpp. References mTime. |
|
checks if the set of uniform numbers of given team already contains a uniform number unum and inserts it.
Definition at line 231 of file gamestateaspect.cpp. |
|
Used by the SexpMonitor to check if the terminating message should be sent.
Definition at line 47 of file gamestateaspect.h. References mFinished. |
|
set the current play mode randomly to PM_KickOff_Left or PM_KickOff_Right.
Definition at line 103 of file gamestateaspect.cpp. References GH_FIRST, mGameHalf, mLastKickOff, PM_KickOff_Left, PM_KickOff_Right, SetPlayMode(), TI_LEFT, TI_NONE, and TI_RIGHT. Here is the call graph for this function: ![]() |
|
setup the init positions for the agents
Reimplemented from SoccerControlAspect. Definition at line 377 of file gamestateaspect.cpp. References SoccerBase::GetSoccerVar(), mAgentRadius, mLeftInit, and mRightInit. Here is the call graph for this function: ![]() |
|
called from the InitEffector to request an initial position for an agent
Definition at line 358 of file gamestateaspect.cpp. References zeitgeist::Object::GetLog(), mAgentRadius, mLeftInit, mRightInit, TI_LEFT, and TI_NONE. Here is the call graph for this function: ![]() |
|
called from the InitEffector to request a uniformn number and teamname
|
|
returns the next uniform number not taken for the given team
Definition at line 405 of file gamestateaspect.cpp. |
|
increments the score of a team
Definition at line 329 of file gamestateaspect.cpp. |
|
sets the current game half
Definition at line 309 of file gamestateaspect.cpp. |
|
sets the current play mode
Definition at line 85 of file gamestateaspect.cpp. References zeitgeist::Object::GetLog(), mFupTime, mLastModeChange, mLeadTime, mPlayMode, mTime, and SoccerBase::PlayMode2Str(). Referenced by KickOff(). Here is the call graph for this function: ![]() |
|
sets the name of a team
Definition at line 182 of file gamestateaspect.cpp. |
|
called during the update of the GameControlServer to allow the ControlAspect to perform any necessary checks.
Implements oxygen::ControlAspect. Definition at line 73 of file gamestateaspect.cpp. References UpdateTime(). Here is the call graph for this function: ![]() |
|
advances the game time
Definition at line 57 of file gamestateaspect.cpp. References mFupTime, mLeadTime, mPlayMode, mTime, PM_BeforeKickOff, and PM_GameOver. Referenced by Update(). |
|
the radius of an agent
Definition at line 163 of file gamestateaspect.h. Referenced by OnLink(), and RequestInitPosition(). |
|
flag if the simulation should be stopped
Definition at line 165 of file gamestateaspect.h. Referenced by Finish(), GameStateAspect(), and IsFinished(). |
|
the time in game state Game Over
Definition at line 133 of file gamestateaspect.h. Referenced by GameStateAspect(), GetModeTime(), SetPlayMode(), and UpdateTime(). |
|
the current half of the game
Definition at line 136 of file gamestateaspect.h. Referenced by GameStateAspect(), GetGameHalf(), KickOff(), and SetGameHalf(). |
|
the team that had the last KickOff
Definition at line 139 of file gamestateaspect.h. Referenced by GameStateAspect(), and KickOff(). |
|
the last time the play mode changed
Definition at line 124 of file gamestateaspect.h. Referenced by GameStateAspect(), GetLastModeChange(), GetModeTime(), and SetPlayMode(). |
|
the current time before the match started
Definition at line 130 of file gamestateaspect.h. Referenced by GameStateAspect(), GetModeTime(), SetPlayMode(), and UpdateTime(). |
|
the position where the last left player was put initially
Definition at line 157 of file gamestateaspect.h. Referenced by GameStateAspect(), OnLink(), and RequestInitPosition(). |
|
the maximal uniform number handed out for each team
Definition at line 151 of file gamestateaspect.h. Referenced by GameStateAspect(), InsertUnum(), and RequestUniformNumber(). |
|
the current play mode
Definition at line 121 of file gamestateaspect.h. Referenced by GameStateAspect(), GetModeTime(), GetPlayMode(), SetPlayMode(), and UpdateTime(). |
|
the position where the last right player was put initially
Definition at line 160 of file gamestateaspect.h. Referenced by GameStateAspect(), OnLink(), and RequestInitPosition(). |
|
the scores of two teams
Definition at line 154 of file gamestateaspect.h. Referenced by GameStateAspect(), GetScore(), and ScoreTeam(). |
|
the names of the two teams
Definition at line 145 of file gamestateaspect.h. Referenced by GetTeamIndex(), GetTeamName(), and SetTeamName(). |
|
the current game time
Definition at line 127 of file gamestateaspect.h. Referenced by GameStateAspect(), GetModeTime(), GetTime(), SetPlayMode(), and UpdateTime(). |
|
the set of uniform number for each team
Definition at line 148 of file gamestateaspect.h. Referenced by InsertUnum(). |