mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Removed getStr(bool), replaced with similar toString()
This commit is contained in:
@@ -199,36 +199,15 @@ bool PlayerColor::isValidPlayer() const
|
||||
|
||||
bool PlayerColor::isSpectator() const
|
||||
{
|
||||
return num == SPECTATOR.num;
|
||||
}
|
||||
|
||||
std::string PlayerColor::getStr(bool L10n) const
|
||||
{
|
||||
std::string ret = "unnamed";
|
||||
if(isValidPlayer())
|
||||
{
|
||||
if(L10n)
|
||||
ret = VLC->generaltexth->colors[num];
|
||||
else
|
||||
ret = GameConstants::PLAYER_COLOR_NAMES[num];
|
||||
}
|
||||
else if(L10n)
|
||||
{
|
||||
ret = VLC->generaltexth->allTexts[508];
|
||||
ret[0] = std::tolower(ret[0]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string PlayerColor::getStrCap(bool L10n) const
|
||||
{
|
||||
std::string ret = getStr(L10n);
|
||||
ret[0] = std::toupper(ret[0]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
si32 PlayerColor::decode(const std::string & identifier)
|
||||
return num == SPECTATOR.num;
|
||||
}
|
||||
|
||||
std::string PlayerColor::toString() const
|
||||
{
|
||||
return encode(num);
|
||||
}
|
||||
|
||||
si32 PlayerColor::decode(const std::string & identifier)
|
||||
{
|
||||
return vstd::find_pos(GameConstants::PLAYER_COLOR_NAMES, identifier);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user