Clean up one frontline bounds user.

This commit is contained in:
Dan Albert 2022-09-11 14:45:50 -07:00 committed by Raffson
parent 8af2d888d4
commit aeed7fd42a
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 12 additions and 6 deletions

View File

@ -81,12 +81,8 @@ class Builder(IBuilder[CasFlightPlan, CasLayout]):
location, self.theater, self.coalition.game.settings location, self.theater, self.coalition.game.settings
) )
ingress = bounds.left_position ingress = bounds.left_position
center = ingress.point_from_heading( center = bounds.center
bounds.heading_from_left_to_right.degrees, bounds.length / 2 egress = bounds.right_position
)
egress = ingress.point_from_heading(
bounds.heading_from_left_to_right.degrees, bounds.length
)
ingress_distance = ingress.distance_to_point(self.flight.departure.position) ingress_distance = ingress.distance_to_point(self.flight.departure.position)
egress_distance = egress.distance_to_point(self.flight.departure.position) egress_distance = egress.distance_to_point(self.flight.departure.position)

View File

@ -19,6 +19,16 @@ class FrontLineBounds:
heading_from_left_to_right: Heading heading_from_left_to_right: Heading
length: int 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: class FrontLineConflictDescription:
def __init__( def __init__(