amethyst / amethyst/bracket-lib

Feature request: Add is_blocked() or similar function to BaseMap trait.

Offen
#153 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
1.7k
Forks
126
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.