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