back to lobby state when server ends

This commit is contained in:
2023-08-14 13:35:17 +02:00
parent 118a04cd01
commit 7f650f282c
7 changed files with 36 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ class Server;
class Lobby {
private:
Server* m_Server;
bool m_GameStarted = false;
bool m_LobbyOpened = false;
std::uint64_t m_StartTimerTime = 0;
std::vector<std::uint8_t> m_Players;
utils::AutoTimer m_Timer;
@@ -22,6 +22,8 @@ public:
void OnPlayerJoin(std::uint8_t playerID);
void OnPlayerLeave(std::uint8_t playerID);
void OpenLobby();
void SendTimeRemaining();
void Tick();

View File

@@ -70,6 +70,8 @@ public:
void Stop(); // force the server to stop
void Close(); // at the end of a game
void Restart(); // go back to lobby state
bool LoadMap(const std::string& worldFilePath);
bool IsMapLoaded();

View File

@@ -171,6 +171,8 @@ public:
void Tick(std::uint64_t delta);
void Reset(); // clear mobs and towers
void SpawnMobAt(MobID id, MobType type, std::uint8_t level, PlayerID sender, float x, float y, Direction dir);
TowerPtr PlaceTowerAt(TowerID id, TowerType type, std::int32_t x, std::int32_t y, PlayerID builder);