#pragma once

/**
 * \file PacketHandler.h
 * \brief File containing the blitz::protocol::PacketHandler class
 */

#include "blitz/protocol/PacketsForward.h"
#include "blitz/protocol/Protocol.h"

namespace blitz {
namespace protocol {

class PacketDispatcher;

/**
 * \class PacketHandler
 * \brief Class used to handle packets
 */
class PacketHandler {
  private:
	PacketDispatcher* m_Dispatcher;

  public:
	/**
	 * \brief Constructor
	 * \param dispatcher The packet dispatcher
	 */
	PacketHandler(PacketDispatcher* dispatcher) : m_Dispatcher(dispatcher) {}
	virtual ~PacketHandler() {}

	/**
	 * \brief Get the packet dispatcher
	 * \return The packet dispatcher
	 */
	PacketDispatcher* GetDispatcher() {
		return m_Dispatcher;
	}

	virtual void HandlePacket(const ChatPacket* packet) {}
	virtual void HandlePacket(const ConnexionInfoPacket* packet) {}
	virtual void HandlePacket(const DisconnectPacket* packet) {}
	virtual void HandlePacket(const KeepAlivePacket* packet) {}
	virtual void HandlePacket(const PlayerJoinPacket* packet) {}
	virtual void HandlePacket(const PlayerLeavePacket* packet) {}
	virtual void HandlePacket(const PlayerListPacket* packet) {}
	virtual void HandlePacket(const PlayerLoginPacket* packet) {}
	virtual void HandlePacket(const PlayerPositionAndRotationPacket* packet) {}
	virtual void HandlePacket(const PlayerShootPacket* packet) {}
	virtual void HandlePacket(const PlayerStatsPacket* packet) {}
	virtual void HandlePacket(const ServerConfigPacket* packet) {}
	virtual void HandlePacket(const ServerTpsPacket* packet) {}
	virtual void HandlePacket(const UpdateGameStatePacket* packet) {}
	virtual void HandlePacket(const UpdateHealthPacket* packet) {}
};

}  // namespace protocol
}  // namespace blitz