#include <BaseApi.hh>
Public Member Functions | |
| BaseApi (T *rules) | |
| void | setEventHandler (Event *evp) |
| Set the class (usually, in the GUI) that will receive rules event. | |
| int | getState () const |
| Get the current game state. | |
| const char * | getStateString () const |
| Get the current game state, stringinfied. | |
| int | getTeamId () const |
| Get the team id [0..nbTeams-1]. | |
| int | getTeamNumber () const |
| Get the number of real team (spectators not counted) that are playing. | |
| bool | isBusy () const |
| Check if the rules is processing some command, or if it safe to send the next one in a sequence. | |
| const PacketHistory & | getEventsHistory () const |
| Get read-only events history. | |
Protected Attributes | |
| T * | rules_ |
| Contest CRules. | |
Base class for API. Add the common API methods for all contests.
| const PacketHistory & BaseApi< T >::getEventsHistory | ( | ) | const [inline] |
| int BaseApi< T >::getState | ( | ) | const [inline] |
Get the current game state.
References BaseApi< T >::rules_.
Referenced by sdlvisu::VisuPlayer::update(), sdlvisu::Panel::update(), sdlvisu::Map::update(), and sdlvisu::ActionPopup::update().
| int BaseApi< T >::getTeamNumber | ( | ) | const [inline] |
Get the number of real team (spectators not counted) that are playing.
References BaseApi< T >::rules_.
| bool BaseApi< T >::isBusy | ( | ) | const [inline] |
Check if the rules is processing some command, or if it safe to send the next one in a sequence.
References BaseApi< T >::rules_.
Referenced by ConsoleInput::process().
Set the class (usually, in the GUI) that will receive rules event.
This class must inherit from Event.
References BaseApi< T >::rules_.
1.6.3