Brought in nuke's idea for json serialize now to use it.
This commit is contained in:
parent
d798d154ae
commit
96efc990c1
4 changed files with 290 additions and 2 deletions
11
dinkyecs.cpp
Normal file
11
dinkyecs.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue