Not using Weapon anymore.

This commit is contained in:
Zed A. Shaw 2025-06-28 11:53:48 -04:00
parent 57d69015c2
commit 7602fb0b31
5 changed files with 9 additions and 55 deletions

View file

@ -192,54 +192,11 @@ TEST_CASE("confirm copying and constants", "[ecs-constants]") {
REQUIRE(player2.eid == player_info.eid);
}
TEST_CASE("test serialization with nlohmann::json", "[ecs-serialize]") {
/*
DinkyECS::ComponentMap component_map;
DinkyECS::Component<Position>(component_map);
DinkyECS::Component<Velocity>(component_map);
DinkyECS::Component<Motion>(component_map);
DinkyECS::Component<Gravity>(component_map);
DinkyECS::Component<DaGUI>(component_map);
auto data = R"(
[
{
"_type": "Position",
"location": {
"x": 10,
"y": 5
}
},
{
"_type": "Motion",
"dx": 0,
"dy": 1
},
{
"_type": "Velocity",
"x": 0.1,
"y": 10.2
}
]
)"_json;
TEST_CASE("can destroy all entity", "[ecs-destroy]") {
DinkyECS::World world;
DinkyECS::Entity ent1 = world.entity();
DinkyECS::Entity ent2 = world.entity();
auto entity = world.entity();
DinkyECS::configure(component_map, world, ent1, data);
DinkyECS::configure(component_map, world, ent2, data);
world.query<Position, Motion>([&](const auto ent, auto &pos, auto &motion) {
fmt::println("entity: {}; position={},{} and motion={},{} motion.random={}",
ent, pos.location.x, pos.location.y,
motion.dx, motion.dy, motion.random);
REQUIRE(pos.location.x == 10);
REQUIRE(pos.location.y == 5);
REQUIRE(motion.dx == 0);
REQUIRE(motion.dy == 1);
REQUIRE(motion.random == false);
});
*/
world.set<Velocity>(entity, {10,10});
world.set<Gravity>(entity, {1});
world.set<Motion>(entity, {0,0});
}