diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-11 05:10:20 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-09-11 14:20:10 +0200 |
commit | ee39bb46e698cb302e3c5a5cfb1a0f533fcea148 (patch) | |
tree | 47e4cb0c2456fbe809071306a1b79f96df313d1a /test/path-search.cpp | |
parent | be8ab17542bea5d783166f320cf3ed02b7b88b20 (diff) |
wip
Diffstat (limited to 'test/path-search.cpp')
-rw-r--r-- | test/path-search.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/path-search.cpp b/test/path-search.cpp index faa16a06..15d1e359 100644 --- a/test/path-search.cpp +++ b/test/path-search.cpp @@ -12,22 +12,23 @@ namespace { void test_bbox() { - auto metal2 = loader.tile_atlas("metal2", {2, 2}, pass_mode::blocked); - auto table = loader.scenery("table1"); + constexpr auto sample = [](chunk& c, search::bbox bb) { + return search::sample_rtree_1(c, bb.min, bb.max, (object_id)-1); + }; + + constexpr auto bbox = [](Vector2i coord, rotation r) { + return search::make_neighbor_tile_bbox(coord, {}, r); + }; + + const auto metal2 = loader.tile_atlas("metal2", {2, 2}, pass_mode::blocked); + const auto table = loader.scenery("table1"); + { auto w = world(); auto& c12 = w[chunk_coords_{1, 2, 0}]; [[maybe_unused]] auto& c11 = w[chunk_coords_{1, 1, 0}]; c12[{0, 0}].wall_north() = {metal2, 0}; - constexpr auto sample = [](chunk& c, search::bbox bb) { - return search::sample_rtree_1(c, bb.min, bb.max, (object_id)-1); - }; - - constexpr auto bbox = [](Vector2i coord, rotation r) { - return search::make_neighbor_tile_bbox(coord, {}, r); - }; - using enum rotation; fm_assert( !sample(c12, bbox({0, 0}, N)) ); |