34 int LoadHjson(
const Hjson::Value& values);
42 glm::vec3
LoadColor(
const Hjson::Value& value, std::string_view identifier);
43 glm::vec3
LoadColor(
const Hjson::Value& value);
55 template <
typename Comp>
57 handles.emplace(std::string(tag), [](
Node& node) { node.emplace<Comp>(); });
60 void Apply(std::string_view tag,
Node& node)
const;
Definition: universe.h:39
Definition: universe.h:59
Definition: hjsonloader.h:29
virtual void PostLoad(const Node &node)
Definition: hjsonloader.h:36
virtual ~HjsonLoader()=default
glm::vec3 LoadColor(const Hjson::Value &value, std::string_view identifier)
Definition: hjsonloader.cpp:106
Universe & universe
Definition: hjsonloader.h:40
int LoadHjson(const Hjson::Value &values)
Definition: hjsonloader.cpp:32
virtual bool LoadValue(const Hjson::Value &values, Node &node)=0
HjsonLoader(Universe &universe)
Definition: hjsonloader.h:31
uint32_t StringHash(std::string_view)
Definition: hjsonloader.cpp:94
virtual const Hjson::Value & GetDefaultValues()=0
virtual bool NeedIdentifier()
Definition: hjsonloader.h:37
Definition: hjsonloader.h:47
std::function< void(Node &)> Handler
Definition: hjsonloader.h:49
void Apply(std::string_view tag, Node &node) const
Definition: hjsonloader.cpp:85
void ParseTags(const Hjson::Value &tags, Node &node) const
Definition: hjsonloader.cpp:79
std::map< std::string, Handler > handles
Definition: hjsonloader.h:65
void Register(std::string_view tag)
Definition: hjsonloader.h:56
void Register(std::string_view tag, Handler handler)
Definition: hjsonloader.h:50
Definition: economyloader.cpp:24