BaseApi< T > Class Template Reference

#include <BaseApi.hh>

List of all members.

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 PacketHistorygetEventsHistory () const
 Get read-only events history.

Protected Attributes

T * rules_
 Contest CRules.

Detailed Description

template<typename T>
class BaseApi< T >

Base class for API. Add the common API methods for all contests.


Member Function Documentation

template<typename T >
const PacketHistory & BaseApi< T >::getEventsHistory (  )  const [inline]

Get read-only events history.

Returns:
events history.

References BaseApi< T >::rules_.

template<typename T >
int BaseApi< T >::getState (  )  const [inline]

Get the current game state.

Returns:
A constant describing the current game state.

References BaseApi< T >::rules_.

Referenced by sdlvisu::VisuPlayer::update(), sdlvisu::Panel::update(), sdlvisu::Map::update(), and sdlvisu::ActionPopup::update().

template<typename T >
int BaseApi< T >::getTeamNumber (  )  const [inline]

Get the number of real team (spectators not counted) that are playing.

References BaseApi< T >::rules_.

template<typename T >
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.

See also:
BaseCRules::isBusy()
Returns:
true if rules is processing a message.

References BaseApi< T >::rules_.

Referenced by ConsoleInput::process().

template<typename T >
void BaseApi< T >::setEventHandler ( Event evp  )  [inline]

Set the class (usually, in the GUI) that will receive rules event.

This class must inherit from Event.

References BaseApi< T >::rules_.


The documentation for this class was generated from the following file:
Generated on Mon Apr 5 21:17:26 2010 for Stechec/TBT by  doxygen 1.6.3