BROKEN: Big refactoring happening, so it compiles but game does not run and the tests fail.

This commit is contained in:
Zed A. Shaw 2025-02-08 14:03:09 -05:00
parent 96efc990c1
commit 9e91c71125
25 changed files with 128 additions and 526 deletions

View file

@ -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);
}
}