Skip to content

Commit

Permalink
Fix pyright issues in pathing (#1809)
Browse files Browse the repository at this point in the history
  • Loading branch information
pushfoo committed Jun 5, 2023
1 parent 2583a89 commit 8c5fde5
Showing 1 changed file with 3 additions and 2 deletions.
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
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

0 comments on commit 8c5fde5

Please sign in to comment.