35 lines
772 B
C++
35 lines
772 B
C++
#pragma once
|
|
|
|
#include <server/IServerState.h>
|
|
#include <td/game/World.h>
|
|
#include <td/simulation/ServerSimulation.h>
|
|
|
|
namespace td {
|
|
namespace server {
|
|
|
|
class GameStateHandler;
|
|
|
|
class GameState : public IServerState {
|
|
private:
|
|
std::shared_ptr<game::World> m_World;
|
|
sim::ServerSimulation m_Simulation;
|
|
float m_Time;
|
|
|
|
public:
|
|
GameState(const std::shared_ptr<game::World>& a_World);
|
|
~GameState() {}
|
|
|
|
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;
|
|
|
|
protected:
|
|
virtual void Init() override;
|
|
|
|
friend class GameStateHandler;
|
|
};
|
|
|
|
} // namespace server
|
|
} // namespace td
|