#pragma once

#include "td/protocol/Protocol.h"
#include "td/game/BaseGame.h"

namespace td {
namespace protocol {

class UpdatePlayerTeamPacket : public Packet {
private:
	std::uint8_t m_PlayerID;
	game::TeamColor m_SelectedTeam;
public:
	UpdatePlayerTeamPacket() {}
	UpdatePlayerTeamPacket(std::uint8_t playerID, game::TeamColor selectedTeam) : m_PlayerID(playerID), m_SelectedTeam(selectedTeam) {}
	virtual ~UpdatePlayerTeamPacket() {}

	virtual DataBuffer Serialize(bool packetID = true) const;
	virtual void Deserialize(DataBuffer& data);
	virtual void Dispatch(PacketHandler* handler) const;

	game::TeamColor GetSelectedTeam() const { return m_SelectedTeam; }
	std::uint8_t GetPlayerID() const { return m_PlayerID; }

	virtual PacketType GetType() const { return PacketType::UpdatePlayerTeam; }
};

} // namespace protocol
} // namespace td
