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

I have no idea what I'm doing

This commit is contained in:
DJWarmonger
2018-07-26 12:06:55 +02:00
parent 75f8c8b29a
commit 273802c92c
28 changed files with 1887 additions and 431 deletions

View File

@ -28,6 +28,21 @@ Res::ResourceSet::ResourceSet(const JsonNode & node)
push_back(node[name].Float());
}
Res::ResourceSet::ResourceSet(TResource wood, TResource mercury, TResource ore, TResource sulfur, TResource crystal,
TResource gems, TResource gold, TResource mithril)
{
resize(GameConstants::RESOURCE_QUANTITY);
auto d = data();
d[Res::WOOD] = wood;
d[Res::MERCURY] = mercury;
d[Res::ORE] = ore;
d[Res::SULFUR] = sulfur;
d[Res::CRYSTAL] = crystal;
d[Res::GEMS] = gems;
d[Res::GOLD] = gold;
d[Res::MITHRIL] = mithril;
}
void Res::ResourceSet::serializeJson(JsonSerializeFormat & handler, const std::string & fieldName)
{
if(!handler.saving)