mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix typing mistake
This commit is contained in:
parent
cf570adabe
commit
473cda971a
@ -500,13 +500,13 @@ class ConflictTheater:
|
|||||||
distances[cp.id] = dist
|
distances[cp.id] = dist
|
||||||
if dist < closest_distance:
|
if dist < closest_distance:
|
||||||
distances[cp.id] = dist
|
distances[cp.id] = dist
|
||||||
closest_cp_id = min(distances, key=distances.get)
|
closest_cp_id = min(distances, key=distances.get) # type: ignore
|
||||||
|
|
||||||
all_cp_min_distances[(control_point.id, closest_cp_id)] = distances[closest_cp_id]
|
all_cp_min_distances[(control_point.id, closest_cp_id)] = distances[closest_cp_id]
|
||||||
closest_opposing_cps = [
|
closest_opposing_cps = [
|
||||||
self.find_control_point_by_id(i)
|
self.find_control_point_by_id(i)
|
||||||
for i
|
for i
|
||||||
in min(all_cp_min_distances, key=all_cp_min_distances.get)
|
in min(all_cp_min_distances, key=all_cp_min_distances.get) # type: ignore
|
||||||
] # type: List[ControlPoint]
|
] # type: List[ControlPoint]
|
||||||
assert len(closest_opposing_cps) == 2
|
assert len(closest_opposing_cps) == 2
|
||||||
if closest_opposing_cps[0].captured:
|
if closest_opposing_cps[0].captured:
|
||||||
|
|||||||
@ -505,7 +505,7 @@ class GroundConflictGenerator:
|
|||||||
@param enemy_groups Potential enemy groups
|
@param enemy_groups Potential enemy groups
|
||||||
@param n number of nearby groups to take
|
@param n number of nearby groups to take
|
||||||
"""
|
"""
|
||||||
targets = [] # type: Optional[List[VehicleGroup]]
|
targets = [] # type: List[Optional[VehicleGroup]]
|
||||||
sorted_list = sorted(
|
sorted_list = sorted(
|
||||||
enemy_groups,
|
enemy_groups,
|
||||||
key=lambda group: player_group.points[0].position.distance_to_point(group[0].points[0].position)
|
key=lambda group: player_group.points[0].position.distance_to_point(group[0].points[0].position)
|
||||||
@ -520,7 +520,7 @@ class GroundConflictGenerator:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def find_nearest_enemy_group(
|
def find_nearest_enemy_group(
|
||||||
player_group: CombatGroup,
|
player_group: VehicleGroup,
|
||||||
enemy_groups: List[Tuple[VehicleGroup, CombatGroup]]
|
enemy_groups: List[Tuple[VehicleGroup, CombatGroup]]
|
||||||
) -> Optional[VehicleGroup]:
|
) -> Optional[VehicleGroup]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
from typing import Tuple
|
from typing import Tuple, Optional
|
||||||
|
|
||||||
from dcs.country import Country
|
from dcs.country import Country
|
||||||
from dcs.mapping import Point
|
from dcs.mapping import Point
|
||||||
@ -22,8 +22,8 @@ class Conflict:
|
|||||||
attackers_country: Country,
|
attackers_country: Country,
|
||||||
defenders_country: Country,
|
defenders_country: Country,
|
||||||
position: Point,
|
position: Point,
|
||||||
heading: int = None,
|
heading: Optional[int] = None,
|
||||||
size: int = None
|
size: Optional[int] = None
|
||||||
):
|
):
|
||||||
|
|
||||||
self.attackers_side = attackers_side
|
self.attackers_side = attackers_side
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user