1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

Spell configuration: introduce simplifaction mechanism for level conficuration

* also aviable for other handlers
This commit is contained in:
AlexVinS
2014-05-18 18:47:18 +04:00
parent 950ca1156a
commit f2b61f7e69
5 changed files with 48 additions and 18 deletions

View File

@ -864,6 +864,22 @@ void CSpellHandler::afterLoadFinalization()
bonus.sid = spell->id;
}
void CSpellHandler::beforeValidate(JsonNode & object)
{
//handle "base" level info
JsonNode levels = object["levels"];
if(levels["base"].getType() == JsonNode::DATA_STRUCT)
{
JsonUtils::mergeCopy(levels["none"],levels["base"]);
JsonUtils::mergeCopy(levels["basic"],levels["base"]);
JsonUtils::mergeCopy(levels["advanced"],levels["base"]);
JsonUtils::mergeCopy(levels["expert"],levels["base"]);
}
}
CSpellHandler::~CSpellHandler()