def get_next_point_in_shortest_path(self, start, end): if not navigation_cache.loaded: path = self.get_shortest_path(start, end, None) if path: return path.get(0) return start direction = navigation_cache.get_next_direction_in_path(start, end) return mod_point(direction.move_point(start), (self.get_width(), self.get_height()))
def get_neighbours(self, point): neighbours = {} for direction in Direction.ORDERED_DIRECTIONS: neighbours[direction] = mod_point(direction.move_point(point), (self.width, self.height)) return neighbours