amethyst / amethyst/bracket-lib
Feature request: Add is_blocked() or similar function to BaseMap trait.
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
This one is related to my efforts to try and add a JPS algorithm, but I think would have uses outside of that. As far as I can see the only way to check if a given tile is traversable is via the `get_available_exits` function. It would be nice if it were possible to also check whether a arbitrary tile was blocked, without necessarily knowing the route to get there. Essentially passing in a idx value and getting a boolean back as to whether the tile can be moved into.
An example use case of this would be on the A* algorithm, having a quick check at the start to see whether the target tile is actually reachable and if not bailing out immediately without attempting to calculate a path (which would never complete, but pause execution of the thread).
The obvious disadvantage would be that anyone implementing the trait would need to add the logic for an additional function.
I'm happy to knock up a PR for this if it is considered that the advantage of adding it would outweigh the disadvantages.
P.S. Sorry for clogging up the issues with multiple feature requests. If there's a better place to discuss these things I'm happy to jump on there instead.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.