SuperTuxKart
|
This is the interface between the main game and the online implementation. More...
#include <race_event_manager.hpp>
Public Member Functions | |
void | update (int ticks, bool fast_forward) |
In network games this update function is called instead of World::updateWorld(). | |
void | start (std::shared_ptr< GameEventsProtocol > gep) |
void | stop () |
bool | isRunning () |
Returns if this instance is in running state or not. | |
std::shared_ptr< GameEventsProtocol > | getProtocol () const |
bool | protocolStopped () const |
bool | isRaceOver () |
void | kartFinishedRace (AbstractKart *kart, float time) |
Static Public Member Functions | |
static RaceEventManager * | get () |
static void | create () |
static void | destroy () |
static void | clear () |
Private Attributes | |
bool | m_running |
std::weak_ptr< GameEventsProtocol > | m_game_events_protocol |
This is the interface between the main game and the online implementation.
The main game informs this object about important events (e.g. item collected), which need to be forwarded from the server to all clients. This object then triggers the right message from the various running protocols.
void RaceEventManager::update | ( | int | ticks, |
bool | fast_forward | ||
) |
In network games this update function is called instead of World::updateWorld().
ticks | Number of physics time steps - should be 1. |
fast_forward | If true, then only rewinders in network will be updated, but not the physics. |