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()
|
LobbyProtocol::~LobbyProtocol()
|
||||||
{
|
{
|
||||||
|
if (RaceEventManager::getInstance())
|
||||||
|
RaceEventManager::getInstance()->stop();
|
||||||
delete m_game_setup;
|
delete m_game_setup;
|
||||||
} // ~LobbyProtocol
|
} // ~LobbyProtocol
|
||||||
|
|
||||||
|
@ -49,19 +49,6 @@ void RaceEventManager::update(int ticks)
|
|||||||
}
|
}
|
||||||
} // update
|
} // 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()
|
bool RaceEventManager::isRaceOver()
|
||||||
{
|
{
|
||||||
|
@ -48,17 +48,25 @@ private:
|
|||||||
virtual ~RaceEventManager();
|
virtual ~RaceEventManager();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
void update(int ticks);
|
void update(int ticks);
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
void start(std::shared_ptr<GameEventsProtocol> gep);
|
void start(std::shared_ptr<GameEventsProtocol> gep)
|
||||||
void stop();
|
{
|
||||||
bool isRaceOver();
|
m_game_events_protocol = gep;
|
||||||
|
m_running = true;
|
||||||
void collectedItem(Item *item, AbstractKart *kart);
|
}
|
||||||
void kartFinishedRace(AbstractKart *kart, float time);
|
// ------------------------------------------------------------------------
|
||||||
|
void stop() { m_running = false; }
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
/** Returns if this instance is in running state or not. */
|
/** 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…
x
Reference in New Issue
Block a user