fix warnings + cland-tidy

This commit is contained in:
2025-07-23 19:18:25 +02:00
parent 705671148b
commit 9477099cfc
13 changed files with 47 additions and 12 deletions

View File

@@ -17,7 +17,7 @@ class Spawn : public utils::shape::Rectangle {
private:
Direction m_Direction;
public:
Spawn() {
Spawn() : m_Direction(Direction::PositiveX) {
SetWidth(5);
SetHeight(5);
}

View File

@@ -88,7 +88,7 @@ class World {
return m_CurrentState.m_Mobs;
}
const Color* GetTileColor(TilePtr tile) const;
const Color* GetTileColor(const TilePtr& tile) const;
Team& GetRedTeam() {
return m_CurrentState.m_Teams[static_cast<std::uint8_t>(TeamColor::Red)];

View File

@@ -39,6 +39,7 @@ static constexpr Color BLUE{0, 0, 255};
struct Tile {
virtual TileType GetType() const = 0;
virtual ~Tile() = default;
};
struct TowerTile : Tile {
@@ -118,4 +119,4 @@ struct hash<td::game::ChunkCoord> {
return std::hash<std::int16_t>()(key.x << 16 | key.y);
}
};
} // namespace std
} // namespace std

View File

@@ -30,7 +30,7 @@ private:
Point m_Center;
float m_Width, m_Height;
public:
Rectangle() {}
Rectangle() : m_Center(), m_Width(0), m_Height(0) {}
const Point& GetCenter() const { return m_Center; }
float GetCenterX() const { return m_Center.GetX(); }
@@ -92,5 +92,5 @@ public:
};
} // namespace shape
} // namespace utils
} // namespace utils
} // namespace td

View File

@@ -16,7 +16,7 @@ struct RenderData {
GL::VertexArray LoadMobModel();
GL::VertexArray LoadWorldModel(const td::game::World* world);
GL::VertexArray LoadTileSelectModel();
RenderData LoadTowerModel(game::TowerPtr tower);
RenderData LoadTowerModel(const game::TowerPtr& tower);
} // namespace WorldLoader

View File

@@ -13,6 +13,7 @@ namespace sim {
class IWorldSystem {
public:
virtual void Tick(const game::World& a_World, WorldSnapshot& a_State, FpFloat a_Delta) = 0;
virtual ~IWorldSystem() = default;
};
class WorldTicker {
@@ -32,7 +33,7 @@ class WorldTicker {
template <typename T>
void AddSystem() {
m_Systems.push_back(std::move(std::make_unique<T>()));
m_Systems.push_back(std::make_unique<T>());
}
};