#pragma once

#include "blitz/game/Game.h"
#include "blitz/protocol/PacketHandler.h"

namespace blitz {

class Client;

namespace client {

class ClientGame : public game::Game, public protocol::PacketHandler {
  private:
	Client* m_Client;

  public:
	ClientGame(Client* client, protocol::PacketDispatcher* dispatcher);
	virtual ~ClientGame();

	void Tick(std::uint64_t delta) override;

	virtual void HandlePacket(const protocol::PlayerJoinPacket* packet) override;
	virtual void HandlePacket(const protocol::PlayerLeavePacket* packet) override;
	virtual void HandlePacket(const protocol::PlayerListPacket* packet) override;
	virtual void HandlePacket(const protocol::PlayerPositionAndRotationPacket* packet) override;

  private:
	void RegisterHandlers();
};

}  // namespace client
}  // namespace blitz
