amethyst / amethyst/bracket-lib

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

Đang mở
#153 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
1.7k
Fork
126
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.