29 lines
531 B
C++
29 lines
531 B
C++
#include "game/Player.h"
|
|
|
|
#include <algorithm>
|
|
|
|
namespace td {
|
|
namespace game {
|
|
|
|
Team::Team(TeamColor color) : m_Color(color), m_TeamCastle(this) {}
|
|
|
|
void Team::addPlayer(Player* newPlayer) {
|
|
m_Players.push_back(newPlayer);
|
|
}
|
|
|
|
void Team::removePlayer(const Player* player) {
|
|
m_Players.erase(std::find(m_Players.begin(), m_Players.end(), player));
|
|
}
|
|
|
|
TeamColor Team::getColor() const {
|
|
return m_Color;
|
|
}
|
|
|
|
std::uint8_t Team::getPlayerCount() const {
|
|
return m_Players.size();
|
|
}
|
|
|
|
|
|
} // namespace game
|
|
} // namespace td
|