mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-03 23:19:22 +02:00
Fixes
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
#include <vcmi/FactionService.h>
|
||||
#include <vcmi/HeroType.h>
|
||||
#include <vcmi/HeroTypeService.h>
|
||||
#include <vcmi/HeroClass.h>
|
||||
#include <vcmi/HeroClassService.h>
|
||||
|
||||
#include <vcmi/spells/Spell.h>
|
||||
#include <vcmi/spells/Service.h>
|
||||
@@ -103,6 +105,25 @@ namespace GameConstants
|
||||
#endif
|
||||
}
|
||||
|
||||
si32 HeroClassID::decode(const std::string & identifier)
|
||||
{
|
||||
auto rawId = VLC->identifiers()->getIdentifier(ModScope::scopeMap(), "heroClass", identifier);
|
||||
if(rawId)
|
||||
return rawId.value();
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::string HeroClassID::encode(const si32 index)
|
||||
{
|
||||
return VLC->heroClasses()->getByIndex(index)->getJsonKey();
|
||||
}
|
||||
|
||||
std::string HeroClassID::entityType()
|
||||
{
|
||||
return "heroClass";
|
||||
}
|
||||
|
||||
si32 HeroTypeID::decode(const std::string & identifier)
|
||||
{
|
||||
auto rawId = VLC->identifiers()->getIdentifier(ModScope::scopeMap(), "hero", identifier);
|
||||
|
||||
Reference in New Issue
Block a user