1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

- Rewrote Kingdom Overview window - all should be stable now

- New classes for GUI - lists and tabs
- finishing work on Json config in animations
This commit is contained in:
Ivan Savenko
2011-07-22 16:22:22 +00:00
parent f5874540b3
commit 35a528e062
9 changed files with 1940 additions and 1116 deletions

View File

@@ -5,6 +5,8 @@
#include <fstream>
#include <sstream>
const JsonNode JsonNode::nullNode;
JsonNode::JsonNode(JsonType Type):
type(DATA_NULL)
{
@@ -76,6 +78,11 @@ void JsonNode::setType(JsonType Type)
}
}
bool JsonNode::isNull() const
{
return type == DATA_NULL;
}
bool & JsonNode::Bool()
{
setType(DATA_BOOL);
@@ -137,6 +144,19 @@ const JsonMap & JsonNode::Struct() const
return *data.Struct;
}
JsonNode & JsonNode::operator[](std::string child)
{
return Struct()[child];
}
const JsonNode & JsonNode::operator[](std::string child) const
{
JsonMap::const_iterator it = Struct().find(child);
if (it != Struct().end())
return it->second;
return nullNode;
}
////////////////////////////////////////////////////////////////////////////////
//Helper to write content of map/vector