From 9ff017f1d4c1502fca9797aa4b38351c97e57982 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 2 Mar 2024 10:20:40 +0100 Subject: a --- test/critter.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/critter.cpp (limited to 'test/critter.cpp') diff --git a/test/critter.cpp b/test/critter.cpp new file mode 100644 index 00000000..6eb42315 --- /dev/null +++ b/test/critter.cpp @@ -0,0 +1,55 @@ +#include "app.hpp" +#include "compat/shared-ptr-wrapper.hpp" +#include "src/critter.hpp" +#include "src/world.hpp" +#include "src/wall-atlas.hpp" +#include "loader/loader.hpp" + +namespace floormat { + +namespace { + +/* ***** TEST 1 ***** + * + * wall n 0x0 - 8:9 + * wall n 0x1 - 8:0 + * + * npc speed=5 bbox-offset=0 bbox-size=32x32 + * + * before chunk=0x0 tile=8:15 offset=-8:8 + * after chunk=0x0 tile=8:9 offset=-8:-16 +*/ + +template void test1(F&& make_dt) +{ + const auto W = wall_image_proto{ loader.wall_atlas("empty"), 0 }; + + auto w = world(); + w[{{0,0,0}, {8,9}}].t.wall_north() = W; + w[{{0,1,0}, {8,0}}].t.wall_north() = W; + + critter_proto cproto; + cproto.name = "Player"_s; + cproto.speed = 10; + cproto.playable = true; + + object_id id = 0; + w.ensure_player_character(id, move(cproto)); + + w[chunk_coords_{0,0,0}].mark_modified(); + w[chunk_coords_{0,1,0}].mark_modified(); +} + +template void test2(F&& make_dt) +{ + // TODO diagonal! +} + +} // namespace + +void test_app::test_critter() +{ + +} + +} // namespace floormat -- cgit v1.2.3