Streamlining

This commit is contained in:
Raffson
2023-10-07 18:53:16 +02:00
parent 75498fe061
commit 62a40db9ea
6 changed files with 21 additions and 25 deletions

View File

@@ -86,7 +86,7 @@ class DrawingsGenerator:
"""
for front_line in self.game.theater.conflicts():
bounds = FrontLineConflictDescription.frontline_bounds(
front_line, self.game.theater, self.game.settings
front_line, self.game.theater
)
end_point = bounds.left_position.point_from_heading(

View File

@@ -72,11 +72,12 @@ class FrontLineConflictDescription:
@classmethod
def frontline_bounds(
cls, front_line: FrontLine, theater: ConflictTheater, settings: Settings
cls, front_line: FrontLine, theater: ConflictTheater
) -> FrontLineBounds:
"""
Returns a vector for a valid frontline location avoiding exclusion zones.
"""
settings = front_line.coalition.game.settings
center_position, heading = cls.frontline_position(front_line, theater, settings)
left_heading = heading.left
right_heading = heading.right
@@ -96,12 +97,12 @@ class FrontLineConflictDescription:
@classmethod
def frontline_cas_conflict(
cls, front_line: FrontLine, theater: ConflictTheater, settings: Settings
cls, front_line: FrontLine, theater: ConflictTheater
) -> FrontLineConflictDescription:
# TODO: Break apart the front-line and air conflict descriptions.
# We're wastefully not caching the front-line bounds here because air conflicts
# can't compute bounds, only a position.
bounds = cls.frontline_bounds(front_line, theater, settings)
bounds = cls.frontline_bounds(front_line, theater)
conflict = cls(
theater=theater,
front_line=front_line,

View File

@@ -204,7 +204,7 @@ class MissionGenerator:
player_cp = front_line.blue_cp
enemy_cp = front_line.red_cp
conflict = FrontLineConflictDescription.frontline_cas_conflict(
front_line, self.game.theater, self.game.settings
front_line, self.game.theater
)
# Generate frontline ops
player_gp = self.game.ground_planners[player_cp.id].units_per_cp[

View File

@@ -81,7 +81,7 @@ class VisualsGenerator:
continue
bounds = FrontLineConflictDescription.frontline_bounds(
front_line, self.game.theater, self.game.settings
front_line, self.game.theater
)
for offset in range(