Fix type errors with Flight.start_type in the UI.

Also reorders the enum so that iteration shows the order we want in the
UI by default.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1672
This commit is contained in:
Dan Albert
2021-10-23 12:18:48 -07:00
parent b728fcc2d6
commit 14769c0350
4 changed files with 16 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ class StartType(Enum):
IN_FLIGHT.
"""
IN_FLIGHT = "In Flight"
RUNWAY = "Runway"
COLD = "Cold"
WARM = "Warm"
RUNWAY = "Runway"
IN_FLIGHT = "In Flight"

View File

@@ -56,6 +56,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING
from game.ato.starttype import StartType
from game.commander.tasks.compound.nextaction import PlanNextAction
from game.commander.tasks.theatercommandertask import TheaterCommanderTask
from game.commander.theaterstate import TheaterState
@@ -70,7 +71,7 @@ class TheaterCommander(Planner[TheaterState, TheaterCommanderTask]):
def __init__(self, game: Game, player: bool) -> None:
super().__init__(
PlanNextAction(
aircraft_cold_start=game.settings.default_start_type == "Cold"
aircraft_cold_start=game.settings.default_start_type is StartType.COLD
)
)
self.game = game