add StateMachine
This commit is contained in:
23
include/server/ServerState.h
Normal file
23
include/server/ServerState.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <server/Server.h>
|
||||
#include <td/misc/SlotGuard.h>
|
||||
|
||||
namespace td {
|
||||
namespace server {
|
||||
|
||||
class ServerState : public Server::State, private utils::SlotGuard {
|
||||
public:
|
||||
virtual void HandlePacket(PlayerID a_Id, const protocol::PacketBase& a_Packet) = 0;
|
||||
virtual void Update(float a_Delta) = 0;
|
||||
|
||||
ServerState(Server& a_Server);
|
||||
virtual ~ServerState();
|
||||
|
||||
protected:
|
||||
void SendPacket(PlayerID a_Id, const protocol::PacketBase& a_Packet);
|
||||
void BroadcastPacket(const protocol::PacketBase& a_Packet);
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
} // namespace td
|
||||
Reference in New Issue
Block a user