1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

first part of town configuration:

- moved almost all loading to TownHandler
- CBuildings and CStructures are now part of CTown
- merged hall.json into buildings.json

Should not cause any crashes or glitches
This commit is contained in:
Ivan Savenko
2012-09-02 10:33:41 +00:00
parent 3e346e737a
commit 44cc848edc
23 changed files with 816 additions and 786 deletions

View File

@@ -1,10 +1,24 @@
#include "StdInc.h"
#include "ResourceSet.h"
#include "GameConstants.h"
#include "JsonNode.h"
Res::ResourceSet::ResourceSet()
{
resize(GameConstants::RESOURCE_QUANTITY, 0);
}
Res::ResourceSet::ResourceSet(const JsonNode & node)
{
resize(GameConstants::RESOURCE_QUANTITY, 0);
at(0) = node["wood"].Float();
at(1) = node["mercury"].Float();
at(2) = node["ore"].Float();
at(3) = node["sulfur"].Float();
at(4) = node["crystal"].Float();
at(5) = node["gems"].Float();
at(6) = node["gold"].Float();
at(7) = node["mithril"].Float();
}
bool Res::ResourceSet::nonZero() const