#pragma once

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

namespace td {
namespace protocol {

class WorldAddTowerPacket : public Packet {
private:
	game::TowerID m_TowerID;
	std::int32_t m_TowerX, m_TowerY;
	game::TowerType m_TowerType;
	game::PlayerID m_Builder;
public:
	WorldAddTowerPacket() {}
	WorldAddTowerPacket(game::TowerID id, std::int32_t x, std::int32_t y, game::TowerType type, game::PlayerID player) :
		m_TowerID(id), m_TowerX(x), m_TowerY(y), m_TowerType(type), m_Builder(player) {
	}
	virtual ~WorldAddTowerPacket() {}

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

	game::TowerID GetTowerID() const { return m_TowerID; }
	std::int32_t GetTowerX() const { return m_TowerX; }
	std::int32_t GetTowerY() const { return m_TowerY; }
	game::TowerType GetTowerType() const { return m_TowerType; }
	game::PlayerID GetBuilder() const { return m_Builder; }

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

} // namespace protocol
} // namespace td
