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

Next part of town configuration:

- town screen is mostly implemented, has some minor issues
- factions are now separate from towns, neutrals have faction with id=9
- more constants to GameConstants: town-specific buildings, strings for terrains and resources
- replaced most access to builtBuildings with isBuilt() method
- replaced id's with enums for town subtype and buildings id's
This commit is contained in:
Ivan Savenko
2012-09-05 12:49:23 +00:00
parent 44cc848edc
commit 0ca9f64573
36 changed files with 1475 additions and 1471 deletions

View File

@ -2,23 +2,17 @@
#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();
{
reserve(GameConstants::RESOURCE_QUANTITY);
BOOST_FOREACH(std::string name, GameConstants::RESOURCE_NAMES)
push_back(node[name].Float());
}
bool Res::ResourceSet::nonZero() const