This commit is contained in:
2025-08-23 12:54:48 +02:00
parent 73dd2dabfa
commit 1d436aa1c3
12 changed files with 93 additions and 24 deletions

View File

@@ -3,27 +3,38 @@
#include <client/IClientSocket.h>
#include <client/PlayerManager.h>
#include <td/common/StateMachine.h>
#include <optional>
namespace td {
namespace client {
class ClientState;
class LoggingState;
class Client : public StateMachine<Client, void, float> {
private:
std::shared_ptr<IClientSocket> m_Socket;
PlayerManager m_Players;
std::optional<PlayerID> m_Id;
public:
Client(const std::shared_ptr<IClientSocket>& a_Socket, const std::string& a_PlayerName);
Client(const std::shared_ptr<IClientSocket>& a_Socket);
~Client();
void SendPacket(const protocol::PacketBase& a_Packet);
void Disconnect();
const PlayerManager& GetPlayers() const {
return m_Players;
}
const std::optional<PlayerID> GetId() const {
return m_Id;
}
friend class ClientState;
friend class LoggingState;
};
} // namespace client