Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pyright issues in pathing #1809

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions arcade/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Classic A-star algorithm for path finding.
"""
from typing import (
cast,
List,
Optional,
Set,
Expand Down Expand Up @@ -168,7 +169,7 @@ def _AStarSearch(start: Point, end: Point, graph: _AStarGraph) -> Optional[List[
current = None
current_fscore = None
for pos in sorted(open_vertices):
if current is None or F[pos] < current_fscore:
if current is None or F[pos] < current_fscore: # type: ignore
eruvanos marked this conversation as resolved.
Show resolved Hide resolved
current_fscore = F[pos]
current = pos

Expand Down Expand Up @@ -319,7 +320,7 @@ def astar_calculate_path(start_point: Point,
# Currently 'result' is in grid locations. We need to convert them to pixel
# locations.
revised_result = [_expand(p, grid_size) for p in result]
return revised_result
return cast(List[Point], revised_result)


def has_line_of_sight(observer: Point,
Expand Down
Loading