add StateMachine
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <server/IServerState.h>
|
||||
#include <server/ServerState.h>
|
||||
#include <td/game/World.h>
|
||||
#include <td/simulation/ServerSimulation.h>
|
||||
|
||||
@@ -9,23 +9,18 @@ namespace server {
|
||||
|
||||
class GameStateHandler;
|
||||
|
||||
class GameState : public IServerState {
|
||||
class GameState : public ServerState {
|
||||
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(Server& a_Server, 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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user