#pragma once

#include "blitz/network/Connexion.h"
#include "blitz/protocol/PacketsForward.h"

namespace blitz {

class Client;

namespace client {

class ClientConnexion : public network::Connexion {
  private:
	Client* m_Client;

  public:
	ClientConnexion(Client* client);

	virtual void HandlePacket(const protocol::DisconnectPacket* packet) override;
	virtual void HandlePacket(const protocol::KeepAlivePacket* packet) override;
	virtual void HandlePacket(const protocol::ChatPacket* packet) override;

	virtual bool Connect(const std::string& pseudo, const std::string& address, std::uint16_t port);

  private:
	void Login(const std::string& pseudo);
	void RegisterHandlers();
};

}  // namespace client
}  // namespace blitz
