frontline refactoring

`FrontLine` is tightly coupled with `ConflictTheater`.
  Moved into the same module to prevent circular imports.

Moved `ConflictTheater.frontline_data` from class var
to instance var to allow save games to have different
versions of frontlines.
This commit is contained in:
walterroach
2020-11-15 21:22:13 -06:00
parent c20e9e19cb
commit c1f88b4a5f
12 changed files with 252 additions and 262 deletions

View File

@@ -355,7 +355,7 @@ class GroundObjectsGenerator:
"""
FARP_CAPACITY = 4
def __init__(self, mission: Mission, conflict: Conflict, game,
def __init__(self, mission: Mission, conflict: Conflict, game: Game,
radio_registry: RadioRegistry, tacan_registry: TacanRegistry):
self.m = mission
self.conflict = conflict
@@ -370,7 +370,7 @@ class GroundObjectsGenerator:
center = self.conflict.center
heading = self.conflict.heading - 90
else:
center, heading = self.conflict.frontline_position(self.conflict.from_cp, self.conflict.to_cp)
center, heading = self.conflict.frontline_position(self.conflict.from_cp, self.conflict.to_cp, self.game.theater)
heading -= 90
initial_position = center.point_from_heading(heading, FARP_FRONTLINE_DISTANCE)