#pragma once

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

namespace td {
namespace protocol {

class PlaceTowerPacket : public Packet {
private:
	std::int32_t m_TowerX, m_TowerY;
	game::TowerType m_TowerType;
public:
	PlaceTowerPacket() {}
	PlaceTowerPacket(std::int32_t x, std::int32_t y, game::TowerType type) :
		m_TowerX(x), m_TowerY(y), m_TowerType(type) {
	}
	virtual ~PlaceTowerPacket() {}

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

	std::int32_t GetTowerX() const { return m_TowerX; }
	std::int32_t GetTowerY() const { return m_TowerY; }
	game::TowerType GetTowerType() const { return m_TowerType; }

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

} // namespace protocol
} // namespace td
