Testing my barebones ecs. This test
ecs::registry registry(50);
std::string component_name("MyTest");
registry.new_component(component_name, 20, sizeof(bool));
bool b1 = true, b2 = false, b3 = true;
ecs::entity e1 = registry.new_entity();
registry.set_component(e1, component_name, &b1);
ecs::entity e2 = registry.new_entity();
registry.set_component(e2, component_name, &b2);
registry.delete_entity(e1);
ecs::entity e3 = registry.new_entity();
registry.set_component(e3, component_name, &b3);
e1 = registry.new_entity();
registry.set_component(e1, component_name, &b1);
b1 = false;
registry.set_component(e1, component_name, &b1);
std::cout << "e1 " << e1.id << std::endl;
std::cout << "e2 " << e2.id << std::endl;
std::cout << "e3 " << e3.id << std::endl;
std::cout << "b1 " << *((bool*)registry.get_component(e1, component_name)) << std::endl;
std::cout << "b2 " << *((bool*)registry.get_component(e2, component_name)) << std::endl;
std::cout << "b3 " << *((bool*)registry.get_component(e3, component_name)) << std::endl;
works as intended, yielding
e1 2
e2 1
e3 0
b1 0
b2 0
b3 1