mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Remove bitmasks of PlayerColor's. Add encode/decode methods
This commit is contained in:
@ -228,6 +228,16 @@ std::string PlayerColor::getStrCap(bool L10n) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
si32 PlayerColor::decode(const std::string & identifier)
|
||||
{
|
||||
return vstd::find_pos(GameConstants::PLAYER_COLOR_NAMES, identifier);
|
||||
}
|
||||
|
||||
std::string PlayerColor::encode(const si32 index)
|
||||
{
|
||||
return GameConstants::PLAYER_COLOR_NAMES[index];
|
||||
}
|
||||
|
||||
si32 FactionID::decode(const std::string & identifier)
|
||||
{
|
||||
auto rawId = VLC->identifiers()->getIdentifier(ModScope::scopeGame(), entityType(), identifier);
|
||||
|
Reference in New Issue
Block a user