amethyst / amethyst/bracket-lib

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

未关闭
#153 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
1.7k
派生
126
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。