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:
@ -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
|
||||
|
Reference in New Issue
Block a user