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

IdentifierStorage is now separate handler in VLC

This commit is contained in:
Ivan Savenko
2023-08-25 22:36:00 +03:00
parent c8a6cd74cc
commit 7e27ac7073
8 changed files with 34 additions and 55 deletions

View File

@@ -15,11 +15,33 @@
#include "../JsonNode.h"
#include "../VCMI_Lib.h"
#include "../constants/StringConstants.h"
#include "../spells/CSpellHandler.h"
#include <vstd/StringUtils.h>
VCMI_LIB_NAMESPACE_BEGIN
CIdentifierStorage::CIdentifierStorage()
{
//TODO: moddable spell schools
for (auto i = 0; i < GameConstants::DEFAULT_SCHOOLS; ++i)
registerObject(ModScope::scopeBuiltin(), "spellSchool", SpellConfig::SCHOOL[i].jsonName, SpellConfig::SCHOOL[i].id);
registerObject(ModScope::scopeBuiltin(), "spellSchool", "any", SpellSchool(ESpellSchool::ANY));
for (int i = 0; i < GameConstants::RESOURCE_QUANTITY; ++i)
{
registerObject(ModScope::scopeBuiltin(), "resource", GameConstants::RESOURCE_NAMES[i], i);
}
for(int i=0; i<GameConstants::PRIMARY_SKILLS; ++i)
{
registerObject(ModScope::scopeBuiltin(), "primSkill", NPrimarySkill::names[i], i);
registerObject(ModScope::scopeBuiltin(), "primarySkill", NPrimarySkill::names[i], i);
}
}
void CIdentifierStorage::checkIdentifier(std::string & ID)
{
if (boost::algorithm::ends_with(ID, "."))