Clean up one frontline bounds user.

This commit is contained in:
Dan Albert 2022-09-11 14:45:50 -07:00
parent 08d4fe92d1
commit ba7b3aa473
2 changed files with 12 additions and 6 deletions

View File

@ -80,12 +80,8 @@ class Builder(IBuilder[CasFlightPlan, CasLayout]):
bounds = FrontLineConflictDescription.frontline_bounds(location, self.theater)
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)

View File

@ -20,6 +20,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__(