#include "td/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();
}

void Team::ClearPlayers() {
	m_Players.clear();
}


} // namespace game
} // namespace td
