Factor out Coalition from Game.

This commit is contained in:
Dan Albert
2021-07-12 16:10:12 -07:00
parent 4534758c21
commit 17c19d453b
34 changed files with 471 additions and 437 deletions

View File

@@ -4,7 +4,6 @@ from typing import Iterable, Type
from PySide2.QtWidgets import QComboBox
from dcs.unittype import FlyingType
from game import db
from gen.flights.ai_flight_planner_db import aircraft_for_task
from gen.flights.flight import FlightType
@@ -13,16 +12,12 @@ class QAircraftTypeSelector(QComboBox):
"""Combo box for selecting among the given aircraft types."""
def __init__(
self,
aircraft_types: Iterable[Type[FlyingType]],
country: str,
mission_type: FlightType,
self, aircraft_types: Iterable[Type[FlyingType]], mission_type: FlightType
) -> None:
super().__init__()
self.model().sort(0)
self.setSizeAdjustPolicy(self.AdjustToContents)
self.country = country
self.update_items(mission_type, aircraft_types)
def update_items(self, mission_type: FlightType, aircraft_types):