feat: add tower detection

This commit is contained in:
2021-10-10 12:23:36 +02:00
parent d2551c8864
commit aa6fb73590
3 changed files with 35 additions and 16 deletions

View File

@@ -32,9 +32,9 @@ enum class TowerType : std::uint8_t {
TowerCount
};
enum class TowerSize : bool {
Little = 0, // 3x3
Big, // 5x5
enum class TowerSize : std::uint8_t {
Little = 3, // 3x3
Big = 5, // 5x5
};
enum class TowerPath : std::uint8_t {

View File

@@ -162,6 +162,8 @@ public:
bool CanPlaceLittleTower(const glm::vec2& worldPos, PlayerID player) const;
bool CanPlaceBigTower(const glm::vec2& worldPos, PlayerID player) const;
TowerPtr GetTower(const glm::vec2& position); // returns null if no tower is here
const std::unordered_map<ChunkCoord, ChunkPtr>& getChunks() const { return m_Chunks; }
const Color& getSpawnColor(TeamColor color) const { return m_SpawnColorPalette[(std::size_t)color]; }