1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-24 00:36:29 +02:00

vcmi: use std::optional

This commit is contained in:
Konstantin
2023-04-16 20:42:56 +03:00
parent 0d35606a44
commit 7a5775a9f9
135 changed files with 552 additions and 585 deletions

View File

@@ -762,7 +762,7 @@ void CGMine::serializeJsonOptions(JsonSerializeFormat & handler)
one.String() = GameConstants::RESOURCE_NAMES[resID];
node.Vector().push_back(one);
}
handler.serializeRaw("possibleResources", node, boost::none);
handler.serializeRaw("possibleResources", node, std::nullopt);
}
else
{
@@ -1737,7 +1737,7 @@ void CGScholar::serializeJsonOptions(JsonSerializeFormat & handler)
if(raw)
{
bonusType = PRIM_SKILL;
bonusID = raw.get();
bonusID = raw.value();
}
}
else if(!json["rewardSkill"].String().empty())
@@ -1746,7 +1746,7 @@ void CGScholar::serializeJsonOptions(JsonSerializeFormat & handler)
if(raw)
{
bonusType = SECONDARY_SKILL;
bonusID = raw.get();
bonusID = raw.value();
}
}
else if(!json["rewardSpell"].String().empty())
@@ -1755,7 +1755,7 @@ void CGScholar::serializeJsonOptions(JsonSerializeFormat & handler)
if(raw)
{
bonusType = SPELL;
bonusID = raw.get();
bonusID = raw.value();
}
}
}