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

Serialize town spells

This commit is contained in:
AlexVinS
2016-02-25 22:59:17 +03:00
parent 8b6cf82a01
commit 2021decb91
5 changed files with 61 additions and 24 deletions

View File

@@ -118,6 +118,25 @@ void JsonDeserializer::serializeLIC(const std::string & fieldName, LIC & value)
readLICPart(allOf, value.decoder, true, value.all);
readLICPart(noneOf, value.decoder, true, value.none);
//remove any banned from allowed and required
for(si32 idx = 0; idx < value.none.size(); idx++)
{
if(value.none[idx])
{
value.all[idx] = false;
value.any[idx] = false;
}
}
//add all required to allowed
for(si32 idx = 0; idx < value.all.size(); idx++)
{
if(value.all[idx])
{
value.any[idx] = true;
}
}
}
void JsonDeserializer::serializeString(const std::string & fieldName, std::string & value)