Operation refactor cleanup

Fix bug in closest cp algorithm
This commit is contained in:
walterroach
2020-11-23 22:27:12 -06:00
parent 967574820f
commit 34a7a37409
4 changed files with 7 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ if TYPE_CHECKING:
class AirWarEvent(Event):
"""An Event centered on the overall Air War"""
"""Event handler for the air battle"""
def __str__(self):
return "Frontline attack"
return "AirWar"

View File

@@ -38,7 +38,6 @@ class Event:
location = None # type: Point
from_cp = None # type: ControlPoint
to_cp = None # type: ControlPoint
operation = Operation
difficulty = 1 # type: int
BONUS_BASE = 5
@@ -62,9 +61,9 @@ class Event:
return int(math.log(self.to_cp.importance + 1, DIFFICULTY_LOG_BASE) * self.BONUS_BASE)
def generate(self) -> UnitMap:
self.operation.prepare(self.game)
unit_map = self.operation.generate()
self.operation.current_mission.save(
Operation.prepare(self.game)
unit_map = Operation.generate()
Operation.current_mission.save(
persistency.mission_path_for("liberation_nextturn.miz"))
return unit_map