1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

vcmi: PlayerState is now an Entity

This will reduce code duplication a little bit.
This commit is contained in:
Konstantin
2023-04-04 17:52:33 +03:00
parent 8968f0ef0e
commit ee489f18d2
3 changed files with 37 additions and 5 deletions

View File

@@ -45,11 +45,37 @@ std::string PlayerState::nodeName() const
return "Player " + color.getStrCap(false);
}
PlayerColor PlayerState::getColor() const
PlayerColor PlayerState::getId() const
{
return color;
}
int32_t PlayerState::getIndex() const
{
return color.getNum();
}
int32_t PlayerState::getIconIndex() const
{
return color.getNum();
}
std::string PlayerState::getJsonKey() const
{
return color.getStr(false);
}
std::string PlayerState::getNameTranslated() const
{
return color.getStr(true);
}
std::string PlayerState::getNameTextID() const
{
return color.getStr(false);
}
void PlayerState::registerIcons(const IconRegistar & cb) const
{
//We cannot register new icons for players
}
TeamID PlayerState::getTeam() const
{
return team;