Silence some useless generation warnings.

This commit is contained in:
Dan Albert 2021-11-21 13:52:44 -08:00
parent acd63fdeac
commit f3bf9c0c3c
2 changed files with 28 additions and 17 deletions

View File

@ -487,7 +487,12 @@ REFUELING_CAPABALE = [
def dcs_types_for_task(task: FlightType) -> Sequence[Type[FlyingType]]:
cap_missions = (FlightType.BARCAP, FlightType.TARCAP, FlightType.SWEEP)
cap_missions = (
FlightType.BARCAP,
FlightType.INTERCEPTION,
FlightType.SWEEP,
FlightType.TARCAP,
)
if task in cap_missions:
return CAP_CAPABLE
elif task == FlightType.ANTISHIP:
@ -530,8 +535,11 @@ def aircraft_for_task(task: FlightType) -> list[AircraftType]:
def tasks_for_aircraft(aircraft: AircraftType) -> list[FlightType]:
tasks = []
tasks: list[FlightType] = []
for task in FlightType:
if task is FlightType.FERRY:
# Not a plannable task, so skip it.
continue
if aircraft in aircraft_for_task(task):
tasks.append(task)
return tasks

View File

@ -1,36 +1,36 @@
from typing import Optional, Callable, Iterable
from typing import Callable, Iterable, Optional
from PySide6.QtCore import (
QItemSelection,
QItemSelectionModel,
QModelIndex,
QSize,
Qt,
QItemSelection,
Signal,
)
from PySide6.QtGui import QStandardItemModel, QStandardItem, QIcon
from PySide6.QtGui import QIcon, QStandardItem, QStandardItemModel
from PySide6.QtWidgets import (
QDialog,
QListView,
QVBoxLayout,
QGroupBox,
QLabel,
QWidget,
QScrollArea,
QLineEdit,
QTextEdit,
QCheckBox,
QComboBox,
QDialog,
QGroupBox,
QHBoxLayout,
QLabel,
QLineEdit,
QListView,
QScrollArea,
QStackedLayout,
QTabWidget,
QComboBox,
QTextEdit,
QVBoxLayout,
QWidget,
)
from game import Game
from game.ato.flighttype import FlightType
from game.dcs.aircrafttype import AircraftType
from game.squadrons import AirWing, Pilot, Squadron
from game.theater import ControlPoint, ConflictTheater
from game.ato.flighttype import FlightType
from game.theater import ConflictTheater, ControlPoint
from qt_ui.uiconstants import AIRCRAFT_ICONS
@ -49,6 +49,9 @@ class AllowedMissionTypeControls(QVBoxLayout):
return callback
for task in FlightType:
if task is FlightType.FERRY:
# Not plannable so just skip it.
continue
enabled = task in squadron.mission_types
if enabled:
self.allowed_mission_types.add(task)