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

@@ -1,22 +1,20 @@
#pragma once
#include <server/IServerState.h>
#include <server/ServerState.h>
namespace td {
namespace server {
// this class is temporary useless
class LobbyState : public IServerState {
class LobbyState : public ServerState {
private:
std::shared_ptr<game::World> m_World;
public:
LobbyState(const std::shared_ptr<game::World>& a_World) : m_World(a_World) {}
LobbyState(Server& a_Server, const std::shared_ptr<game::World>& a_World);
~LobbyState() {}
virtual void HandlePacket(PlayerID a_Id, const protocol::PacketBase& a_Packet) override;
virtual void Update(float a_Delta) override;
virtual void OnPlayerJoin(PlayerID a_Id) override;
virtual void OnPlayerLeave(PlayerID a_Id) override;
};
} // namespace server