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