diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-02 10:20:40 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-02 10:20:40 +0100 |
commit | 9ff017f1d4c1502fca9797aa4b38351c97e57982 (patch) | |
tree | 5b122d52ddec31c988e23a70531a968466e73bf6 /test/critter.cpp | |
parent | 58d95d559276b556f584411d5c3ea0a986f3fbc4 (diff) |
a
Diffstat (limited to 'test/critter.cpp')
-rw-r--r-- | test/critter.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
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<typename F> 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<typename F> void test2(F&& make_dt) +{ + // TODO diagonal! +} + +} // namespace + +void test_app::test_critter() +{ + +} + +} // namespace floormat |