GIGA REFACTOR

This commit is contained in:
2022-03-02 18:51:42 +01:00
parent 553b2f6aad
commit 6df59b1487
92 changed files with 1807 additions and 1785 deletions

View File

@@ -24,13 +24,13 @@ private:
Direction m_Direction;
public:
Spawn() {
setWidth(5);
setHeight(5);
SetWidth(5);
SetHeight(5);
}
Direction getDirection() const { return m_Direction; }
Direction GetDirection() const { return m_Direction; }
void setDirection(Direction direction) { m_Direction = direction; }
void SetDirection(Direction direction) { m_Direction = direction; }
};
class Team;
@@ -43,23 +43,23 @@ public:
static constexpr int CastleMaxLife = 1000;
TeamCastle(const Team* team) : m_Team(team), m_Life(CastleMaxLife) {
setWidth(5);
setHeight(5);
SetWidth(5);
SetHeight(5);
}
TeamCastle() : TeamCastle(nullptr) {}
float getLife() const { return m_Life; }
float GetLife() const { return m_Life; }
const Team* getTeam() const { return m_Team; }
void setTeam(const Team* team) { m_Team = team; }
const Team* GetTeam() const { return m_Team; }
void SetTeam(const Team* team) { m_Team = team; }
void setLife(float life) { m_Life = life; }
void damage(float damage) { m_Life = std::max(0.0f, m_Life - damage); }
void SetLife(float life) { m_Life = life; }
void Damage(float damage) { m_Life = std::max(0.0f, m_Life - damage); }
void setShape(utils::shape::Rectangle rect) {
setCenter(rect.getCenter());
setSize(rect.getSize());
void SetShape(utils::shape::Rectangle rect) {
SetCenter(rect.GetCenter());
SetSize(rect.GetSize());
}
};
@@ -72,18 +72,18 @@ private:
public:
Team(TeamColor color);
void addPlayer(Player* newPlayer);
void removePlayer(const Player* player);
void AddPlayer(Player* newPlayer);
void RemovePlayer(const Player* player);
TeamColor getColor() const;
TeamColor GetColor() const;
const Spawn& getSpawn() const { return m_Spawn; }
Spawn& getSpawn() { return m_Spawn; }
const Spawn& GetSpawn() const { return m_Spawn; }
Spawn& GetSpawn() { return m_Spawn; }
const TeamCastle& getCastle() const { return m_TeamCastle; }
TeamCastle& getCastle() { return m_TeamCastle; }
const TeamCastle& GetCastle() const { return m_TeamCastle; }
TeamCastle& GetCastle() { return m_TeamCastle; }
std::uint8_t getPlayerCount() const;
std::uint8_t GetPlayerCount() const;
};
typedef std::array<Team, 2> TeamList;