diff options
Diffstat (limited to 'src/path-search.hpp')
-rw-r--r-- | src/path-search.hpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/path-search.hpp b/src/path-search.hpp index daf3379d..05516676 100644 --- a/src/path-search.hpp +++ b/src/path-search.hpp @@ -2,9 +2,8 @@ #include "tile-constants.hpp" #include "global-coords.hpp" #include "object-id.hpp" -#include "collision.hpp" -#include "compat/function2.fwd.hpp" #include "path-search-result.hpp" +#include "path-search-pred.hpp" #include <array> namespace floormat { @@ -30,26 +29,21 @@ constexpr inline auto div_count = iTILE_SIZE2 * TILE_MAX_DIM / detail_astar::div namespace floormat { struct path_search_result; -enum class path_search_continue : bool { pass = false, blocked = true }; class path_search final { friend struct path_search_result; template<typename T> using bbox = detail_astar::bbox<T>; + using pred = detail_astar::pred; public: - using pred = fu2::function_view<path_search_continue(collision_data) const>; - - static const pred& never_continue() noexcept; - static const pred& always_continue() noexcept; - - static bool is_passable_1(chunk& c, Vector2 min, Vector2 max, object_id own_id, const pred& p = never_continue()); + static bool is_passable_1(chunk& c, Vector2 min, Vector2 max, object_id own_id, const pred& p = detail_astar::never_continue()); static bool is_passable_(chunk* c0, const std::array<chunk*, 8>& neighbors, - Vector2 min, Vector2 max, object_id own_id, const pred& p = never_continue()); - static bool is_passable(world& w, global_coords coord, Vector2b offset, Vector2ui size, object_id own_id, const pred& p = never_continue()); - static bool is_passable(world& w, struct detail_astar::cache& cache, global_coords coord, Vector2b offset, Vector2ui size, object_id own_id, const pred& p = never_continue()); - static bool is_passable(world& w, chunk_coords_ ch0, const bbox<float>& bb, object_id own_id, const pred& p = never_continue()); - static bool is_passable(world& w, struct detail_astar::cache& cache, chunk_coords_ ch0, const bbox<float>& bb, object_id own_id, const pred& p = never_continue()); + Vector2 min, Vector2 max, object_id own_id, const pred& p = detail_astar::never_continue()); + static bool is_passable(world& w, global_coords coord, Vector2b offset, Vector2ui size, object_id own_id, const pred& p = detail_astar::never_continue()); + static bool is_passable(world& w, struct detail_astar::cache& cache, global_coords coord, Vector2b offset, Vector2ui size, object_id own_id, const pred& p = detail_astar::never_continue()); + static bool is_passable(world& w, chunk_coords_ ch0, const bbox<float>& bb, object_id own_id, const pred& p = detail_astar::never_continue()); + static bool is_passable(world& w, struct detail_astar::cache& cache, chunk_coords_ ch0, const bbox<float>& bb, object_id own_id, const pred& p = detail_astar::never_continue()); }; } // namespace floormat |