BROKEN: Big refactoring happening, so it compiles but game does not run and the tests fail.
This commit is contained in:
parent
96efc990c1
commit
9e91c71125
25 changed files with 128 additions and 526 deletions
|
@ -1,10 +1,12 @@
|
|||
#include "dinkyecs.hpp"
|
||||
#include "dbc.hpp"
|
||||
#include <fmt/core.h>
|
||||
|
||||
namespace DinkyECS {
|
||||
void configure(World& world, const ComponentMap& component_map, Entity ent, json& data) {
|
||||
void configure(const ComponentMap& component_map, World& world, Entity ent, json& data) {
|
||||
for (auto &i : data) {
|
||||
assert(i.contains("_type") && i["_type"].is_string());
|
||||
assert(component_map.contains(i["_type"]));
|
||||
dbc::check(i.contains("_type") && i["_type"].is_string(), fmt::format("component has no _type: {}", data.dump()));
|
||||
dbc::check(component_map.contains(i["_type"]), fmt::format("component_map doesn't have type {}", std::string(i["_type"])));
|
||||
component_map.at(i["_type"])(world, ent, i);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue