Files
Tower-Defense/include/game/Team.h

55 lines
937 B
C++

#pragma once
#include "Types.h"
#include <vector>
#include <memory>
#include <cmath>
namespace td {
namespace game {
class Player;
enum class TeamColor : std::int8_t {
None = -1,
Red,
Blue
};
struct Spawn {
Direction direction;
std::int32_t x, y;
};
struct TeamCastle {
std::int32_t x, y;
std::uint16_t life = 1000;
};
class Team {
private:
std::vector<Player*> m_Players;
TeamColor m_Color;
Spawn m_Spawn;
TeamCastle m_TeamCastle;
public:
Team(TeamColor color);
void addPlayer(Player* newPlayer);
void removePlayer(const Player* player);
TeamColor getColor() const;
const Spawn& getSpawn() const { return m_Spawn; }
Spawn& getSpawn() { return m_Spawn; }
const TeamCastle& getCastle() const { return m_TeamCastle; }
TeamCastle& getCastle() { return m_TeamCastle; }
std::uint8_t getPlayerCount() const;
};
} // namespace game
} // namespace td