Brought in nuke's idea for json serialize now to use it.

This commit is contained in:
Zed A. Shaw 2025-02-08 12:04:53 -05:00
parent d798d154ae
commit 96efc990c1
4 changed files with 290 additions and 2 deletions

11
dinkyecs.cpp Normal file
View file

@ -0,0 +1,11 @@
#include "dinkyecs.hpp"
namespace DinkyECS {
void configure(World& world, const ComponentMap& component_map, Entity ent, json& data) {
for (auto &i : data) {
assert(i.contains("_type") && i["_type"].is_string());
assert(component_map.contains(i["_type"]));
component_map.at(i["_type"])(world, ent, i);
}
}
}