From 458de17b8fb1e5f940a74f4e11a531512d3149d7 Mon Sep 17 00:00:00 2001 From: RndName Date: Wed, 21 Jul 2021 17:27:06 +0200 Subject: [PATCH] adopt sam heading to new heading class --- gen/sam/group_generator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gen/sam/group_generator.py b/gen/sam/group_generator.py index d7266186..bbe6bdb9 100644 --- a/gen/sam/group_generator.py +++ b/gen/sam/group_generator.py @@ -72,7 +72,7 @@ class GroupGenerator(Generic[GroupT, UnitT, UnitTypeT, TgoT]): ) -> UnitT: raise NotImplementedError - def heading_to_conflict(self) -> int: + def heading_to_conflict(self) -> Heading: # Heading for a Group to the enemy. # Should be the point between the nearest and the most distant conflict conflicts: dict[MissionTarget, float] = {} @@ -91,7 +91,9 @@ class GroupGenerator(Generic[GroupT, UnitT, UnitTypeT, TgoT]): (closest_conflict.position.y + most_distant_conflict.position.y) / 2, ) - return int(self.go.position.heading_between_point(conflict_center)) + return Heading.from_degrees( + self.go.position.heading_between_point(conflict_center) + ) class VehicleGroupGenerator(