1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +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

@@ -137,7 +137,7 @@ ZoneOptions::ZoneOptions():
type(ETemplateZoneType::PLAYER_START),
size(1),
maxTreasureValue(0),
owner(boost::none),
owner(std::nullopt),
matchTerrainToTown(true),
townsAreSameType(false),
zoneMonsterStrength(EMonsterStrength::ZONE_NORMAL),
@@ -182,7 +182,7 @@ void ZoneOptions::setSize(int value)
size = value;
}
boost::optional<int> ZoneOptions::getOwner() const
std::optional<int> ZoneOptions::getOwner() const
{
return owner;
}
@@ -355,7 +355,7 @@ void ZoneOptions::serializeJson(JsonSerializeFormat & handler)
node.Vector().push_back(n);
}
}
handler.serializeRaw("terrainTypes", node, boost::none);
handler.serializeRaw("terrainTypes", node, std::nullopt);
if(!handler.saving)
{
if(!node.Vector().empty())
@@ -657,7 +657,7 @@ void CRmgTemplate::serializeJson(JsonSerializeFormat & handler)
node.Vector().push_back(n);
}
}
handler.serializeRaw("allowedWaterContent", node, boost::none);
handler.serializeRaw("allowedWaterContent", node, std::nullopt);
if(!handler.saving)
{
for(auto wc : node.Vector())