add StateMachine

This commit is contained in:
2025-08-09 11:23:17 +02:00
parent ac3e949323
commit cba790f804
23 changed files with 174 additions and 244 deletions

View File

@@ -6,9 +6,7 @@
namespace td {
namespace server {
GameState::GameState(const std::shared_ptr<game::World>& a_World) : m_World(a_World), m_Simulation(*m_World, STEP_TIME), m_Time(0) {}
void GameState::Init() {
GameState::GameState(Server& a_Server, const std::shared_ptr<game::World>& a_World) : ServerState(a_Server), m_World(a_World), m_Simulation(*m_World, STEP_TIME), m_Time(0) {
std::cout << "Switched to Game state !\n";
BroadcastPacket(m_Simulation.MakePacket());
}
@@ -28,9 +26,5 @@ void GameState::Update(float a_Delta) {
}
}
void GameState::OnPlayerJoin(PlayerID a_Id) {}
void GameState::OnPlayerLeave(PlayerID a_Id) {}
} // namespace server
} // namespace td