Exploring raycasters and possibly make a little "doom like" game based on it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
raycaster/dinkyecs.cpp

14 lines
520 B

#include "dinkyecs.hpp"
#include "dbc.hpp"
#include <fmt/core.h>
namespace DinkyECS {
void configure(const ComponentMap& component_map, World& world, Entity ent, json& data) {
for (auto &i : data) {
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);
}
}
}