Stop race event manager if exiting lobby
This commit is contained in:
parent
9a32bdcbe1
commit
b6caf00bfc
@ -42,6 +42,8 @@ LobbyProtocol::LobbyProtocol(CallbackObject* callback_object)
|
||||
// ----------------------------------------------------------------------------
|
||||
LobbyProtocol::~LobbyProtocol()
|
||||
{
|
||||
if (RaceEventManager::getInstance())
|
||||
RaceEventManager::getInstance()->stop();
|
||||
delete m_game_setup;
|
||||
} // ~LobbyProtocol
|
||||
|
||||
|
@ -49,19 +49,6 @@ void RaceEventManager::update(int ticks)
|
||||
}
|
||||
} // update
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void RaceEventManager::start(std::shared_ptr<GameEventsProtocol> gep)
|
||||
{
|
||||
m_game_events_protocol = gep;
|
||||
m_running = true;
|
||||
} // start
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void RaceEventManager::stop()
|
||||
{
|
||||
m_running = false;
|
||||
} // stop
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool RaceEventManager::isRaceOver()
|
||||
{
|
||||
|
@ -48,17 +48,25 @@ private:
|
||||
virtual ~RaceEventManager();
|
||||
|
||||
public:
|
||||
// ------------------------------------------------------------------------
|
||||
void update(int ticks);
|
||||
|
||||
void start(std::shared_ptr<GameEventsProtocol> gep);
|
||||
void stop();
|
||||
bool isRaceOver();
|
||||
|
||||
void collectedItem(Item *item, AbstractKart *kart);
|
||||
void kartFinishedRace(AbstractKart *kart, float time);
|
||||
// ------------------------------------------------------------------------
|
||||
void start(std::shared_ptr<GameEventsProtocol> gep)
|
||||
{
|
||||
m_game_events_protocol = gep;
|
||||
m_running = true;
|
||||
}
|
||||
// ------------------------------------------------------------------------
|
||||
void stop() { m_running = false; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns if this instance is in running state or not. */
|
||||
bool isRunning() { return m_running; }
|
||||
bool isRunning() { return m_running; }
|
||||
// ------------------------------------------------------------------------
|
||||
bool isRaceOver();
|
||||
// ------------------------------------------------------------------------
|
||||
void collectedItem(Item *item, AbstractKart *kart);
|
||||
// ------------------------------------------------------------------------
|
||||
void kartFinishedRace(AbstractKart *kart, float time);
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user