refactor: create MainMenu and GameMenu classes

This commit is contained in:
2021-11-04 11:01:46 +01:00
parent 1186e5ee9c
commit 2fc0f28b27
9 changed files with 303 additions and 205 deletions

View File

@@ -36,7 +36,7 @@ void Lobby::tick() {
if (m_GameStarted || m_StartTimerTime == 0)
return;
if (utils::getTime() - m_StartTimerTime >= LOBBY_WAITING_TIME) {
if (utils::getTime() - m_StartTimerTime >= LobbyWaitingTime) {
protocol::UpdateGameStatePacket packet(game::GameState::Game);
m_Server->broadcastPacket(&packet);
m_GameStarted = true;
@@ -48,7 +48,7 @@ void Lobby::tick() {
}
void Lobby::sendTimeRemaining() {
protocol::UpdateLobbyTimePacket packet(LOBBY_WAITING_TIME - (utils::getTime() - m_StartTimerTime)); // converting second to millis
protocol::UpdateLobbyTimePacket packet(LobbyWaitingTime - (utils::getTime() - m_StartTimerTime)); // converting second to millis
m_Server->broadcastPacket(&packet);
}