def get_all_usable_points(self, origin: Point, max_distance: int) -> Dict[int, List[Point]]: distances_to_points = dict.fromkeys(range(max_distance + 1), []) largest_map_distance = sum(self._map.get_size()) stop_checking_map = min(largest_map_distance, max_distance) + 1 for distance in range(stop_checking_map): on_map_pts = [point for point in origin.at_distance(distance) if self._map.is_on_map(point) and self._map.has_tile(point)] distances_to_points[distance] = on_map_pts return distances_to_points
def get_all_usable_points_units_only(self, origin: Point, max_distance: int) -> Dict[int, List[Point]]: distances_to_points = {key: [] for key in range(max_distance+1)} largest_map_distance = sum(self._map.get_size()) stop_checking_map = min(largest_map_distance, max_distance) + 1 for distance in range(stop_checking_map): on_map_pts = [point for point in origin.at_distance(distance) if self._map.has_unit(point)] distances_to_points[distance] = on_map_pts return distances_to_points