indent with tabs

This commit is contained in:
2023-01-02 13:05:43 +01:00
parent 8f95b1a750
commit 222b79b40a
100 changed files with 4783 additions and 4781 deletions

View File

@@ -14,76 +14,76 @@ namespace game {
class Player;
enum class TeamColor : std::int8_t {
None = -1,
Red,
Blue
None = -1,
Red,
Blue
};
class Spawn : public utils::shape::Rectangle {
private:
Direction m_Direction;
Direction m_Direction;
public:
Spawn() {
SetWidth(5);
SetHeight(5);
}
Spawn() {
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;
class TeamCastle : public utils::shape::Rectangle {
private:
const Team* m_Team;
float m_Life;
const Team* m_Team;
float m_Life;
public:
static constexpr int CastleMaxLife = 1000;
static constexpr int CastleMaxLife = 1000;
TeamCastle(const Team* team) : m_Team(team), m_Life(CastleMaxLife) {
SetWidth(5);
SetHeight(5);
}
TeamCastle(const Team* team) : m_Team(team), m_Life(CastleMaxLife) {
SetWidth(5);
SetHeight(5);
}
TeamCastle() : TeamCastle(nullptr) {}
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());
}
};
class Team {
private:
std::vector<Player*> m_Players;
TeamColor m_Color;
Spawn m_Spawn;
TeamCastle m_TeamCastle;
std::vector<Player*> m_Players;
TeamColor m_Color;
Spawn m_Spawn;
TeamCastle m_TeamCastle;
public:
Team(TeamColor color);
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;