mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Streamlining
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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[
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user