add client
This commit is contained in:
33
include/client/IClientState.h
Normal file
33
include/client/IClientState.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <client/IClientSocket.h>
|
||||
#include <td/misc/SlotGuard.h>
|
||||
|
||||
namespace td {
|
||||
namespace client {
|
||||
|
||||
class Client;
|
||||
|
||||
class IClientState : private utils::SlotGuard {
|
||||
public:
|
||||
virtual void HandlePacket(const protocol::PacketBase& a_Packet) = 0;
|
||||
virtual void Update(float a_Delta) = 0;
|
||||
|
||||
IClientState();
|
||||
virtual ~IClientState();
|
||||
|
||||
protected:
|
||||
void SendPacket(const protocol::PacketBase& a_Packet);
|
||||
void SetNewState(const std::shared_ptr<IClientState>& a_NewState);
|
||||
virtual void Init() {}
|
||||
|
||||
private:
|
||||
Client* m_Client;
|
||||
|
||||
void SetClient(Client* a_Client);
|
||||
|
||||
friend class Client;
|
||||
};
|
||||
|
||||
} // namespace server
|
||||
} // namespace td
|
||||
Reference in New Issue
Block a user