Skip to content

Commit

Permalink
operation refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
walterroach committed Nov 21, 2020
1 parent 8889e35 commit f6e0dbb
Show file tree
Hide file tree
Showing 12 changed files with 272 additions and 238 deletions.
2 changes: 1 addition & 1 deletion game/event/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def generate(self):
self.operation.is_awacs_enabled = self.is_awacs_enabled
self.operation.ca_slots = self.ca_slots

self.operation.prepare(self.game.theater.terrain, is_quick=False)
self.operation.prepare(self.game)
self.operation.generate()
self.operation.current_mission.save(persistency.mission_path_for("liberation_nextturn.miz"))
self.environment_settings = self.operation.environment_settings
Expand Down
15 changes: 4 additions & 11 deletions game/event/frontlineattack.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from typing import List, Type

from dcs.task import CAP, CAS, Task
from game.operation.operation import Operation

from game import db
# from game.operation.frontlineattack import FrontlineAttackOperation
from .event import Event
from ..debriefing import Debriefing
from .event import Event


class FrontlineAttackEvent(Event):
Expand Down Expand Up @@ -38,12 +37,6 @@ def skip(self):
if self.to_cp.captured:
self.to_cp.base.affect_strength(-0.1)

def player_attacking(self, flights: db.TaskForceDict):
def player_attacking(self):
assert self.departure_cp is not None
op = FrontlineAttackOperation(game=self.game,
attacker_name=self.attacker_name,
defender_name=self.defender_name,
from_cp=self.from_cp,
departure_cp=self.departure_cp,
to_cp=self.to_cp)
self.operation = op
self.operation = Operation(departure_cp=self.departure_cp,)
Loading

0 comments on commit f6e0dbb

Please sign in to comment.