Limit task type combo box to valid mission types.

This commit is contained in:
Dan Albert
2020-09-25 00:25:25 -07:00
parent 0e1dfb8ccb
commit a3c06ce6e0
3 changed files with 106 additions and 16 deletions

View File

@@ -1,11 +1,9 @@
from typing import List
import uuid
from dcs.mapping import Point
from .missiontarget import MissionTarget
NAME_BY_CATEGORY = {
"power": "Power plant",
"ammo": "Ammo depot",
@@ -102,3 +100,11 @@ class TheaterGroundObject(MissionTarget):
@property
def name(self) -> str:
return self.obj_name
def parent_control_point(
self, theater: "ConflictTheater") -> "ControlPoint":
"""Searches the theater for the parent control point."""
for cp in theater.controlpoints:
if cp.id == self.cp_id:
return cp
raise RuntimeError("Could not find matching control point in theater")