|
@@ -25,19 +25,6 @@ ResourceSet::ResourceSet(const JsonNode & node)
|
|
|
container[i] = static_cast<int>(node[GameConstants::RESOURCE_NAMES[i]].Float());
|
|
container[i] = static_cast<int>(node[GameConstants::RESOURCE_NAMES[i]].Float());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-ResourceSet::ResourceSet(TResource wood, TResource mercury, TResource ore, TResource sulfur, TResource crystal,
|
|
|
|
|
- TResource gems, TResource gold, TResource mithril)
|
|
|
|
|
-{
|
|
|
|
|
- container[GameResID(EGameResID::WOOD)] = wood;
|
|
|
|
|
- container[GameResID(EGameResID::MERCURY)] = mercury;
|
|
|
|
|
- container[GameResID(EGameResID::ORE)] = ore;
|
|
|
|
|
- container[GameResID(EGameResID::SULFUR)] = sulfur;
|
|
|
|
|
- container[GameResID(EGameResID::CRYSTAL)] = crystal;
|
|
|
|
|
- container[GameResID(EGameResID::GEMS)] = gems;
|
|
|
|
|
- container[GameResID(EGameResID::GOLD)] = gold;
|
|
|
|
|
- container[GameResID(EGameResID::MITHRIL)] = mithril;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
void ResourceSet::serializeJson(JsonSerializeFormat & handler, const std::string & fieldName)
|
|
void ResourceSet::serializeJson(JsonSerializeFormat & handler, const std::string & fieldName)
|
|
|
{
|
|
{
|
|
|
if(handler.saving && !nonZero())
|
|
if(handler.saving && !nonZero())
|