Base content package + ContentLoader

This commit is contained in:
MihailRis
2023-12-01 16:26:42 +03:00
parent 6708e1ef86
commit c8a283c645
33 changed files with 317 additions and 111 deletions
+10
View File
@@ -190,6 +190,12 @@ void JObject::num(std::string key, double& dst) const {
dst = found->second->value.num;
}
void JObject::num(std::string key, ubyte& dst) const {
auto found = map.find(key);
if (found != map.end())
dst = found->second->value.num;
}
void JObject::num(std::string key, float& dst) const {
auto found = map.find(key);
if (found != map.end())
@@ -289,6 +295,10 @@ JObject& JObject::put(string key, bool value){
return *this;
}
bool JObject::has(string key) {
return map.find(key) != map.end();
}
Value::Value(valtype type, valvalue value) : type(type), value(value) {
}