diff --git a/game/ato/flightplans/cas.py b/game/ato/flightplans/cas.py index fa508929..5e49e401 100644 --- a/game/ato/flightplans/cas.py +++ b/game/ato/flightplans/cas.py @@ -81,12 +81,8 @@ class Builder(IBuilder[CasFlightPlan, CasLayout]): location, self.theater, self.coalition.game.settings ) ingress = bounds.left_position - center = ingress.point_from_heading( - bounds.heading_from_left_to_right.degrees, bounds.length / 2 - ) - egress = ingress.point_from_heading( - bounds.heading_from_left_to_right.degrees, bounds.length - ) + center = bounds.center + egress = bounds.right_position ingress_distance = ingress.distance_to_point(self.flight.departure.position) egress_distance = egress.distance_to_point(self.flight.departure.position) diff --git a/game/missiongenerator/frontlineconflictdescription.py b/game/missiongenerator/frontlineconflictdescription.py index 2dcefc3e..a3303df3 100644 --- a/game/missiongenerator/frontlineconflictdescription.py +++ b/game/missiongenerator/frontlineconflictdescription.py @@ -19,6 +19,16 @@ class FrontLineBounds: heading_from_left_to_right: Heading length: int + @property + def center(self) -> Point: + return (self.left_position + self.right_position) / 2 + + @property + def right_position(self) -> Point: + return self.left_position.point_from_heading( + self.heading_from_left_to_right.degrees, self.length + ) + class FrontLineConflictDescription: def __init__(