mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
- factor out own class for the iadsnetwork within the conflicttheater - This class will handle all Skynet related things - no specific group_name handling necessary in future - make iadsbuilding own TGO class because SAM & EWRs are Vehicle Groups. IADS Elements dont have any groups attached. - added command center, connection node and power source as Ground objects which can be added by the campaign designer - adjust lua generator to support new iads units - parse the campaign yaml to get the iads network information - use the range as fallback if no yaml information was found - complete rewrite of the skynet lua script - allow destruction of iads network to be persistent over all rounds - modified the presetlocation handling: the wrapper PresetLocation for PointWithHeading now stores the original name from the campaign miz to have the ability to process campaign yaml configurations based on the ground unit - Implementation of the UI representation for the IADS Network - Give user the option to enable or disable advanced iads - Extended the layout system: Implement Sub task handling to support PD
75 lines
2.3 KiB
Python
75 lines
2.3 KiB
Python
from __future__ import annotations
|
|
|
|
from enum import Enum
|
|
|
|
|
|
class GroupRole(Enum):
|
|
"""Role of a ForceGroup within the ArmedForces"""
|
|
|
|
AIR_DEFENSE = "AntiAir"
|
|
BUILDING = "Building"
|
|
DEFENSES = "Defenses"
|
|
GROUND_FORCE = "GroundForce"
|
|
NAVAL = "Naval"
|
|
|
|
@property
|
|
def tasks(self) -> list[GroupTask]:
|
|
return [task for task in GroupTask if task.role == self]
|
|
|
|
|
|
class GroupTask(Enum):
|
|
"""Specific Tasking of a ForceGroup"""
|
|
|
|
def __init__(self, description: str, role: GroupRole):
|
|
self.description = description
|
|
self.role = role
|
|
|
|
@classmethod
|
|
def by_description(cls, description: str) -> GroupTask:
|
|
for task in GroupTask:
|
|
if task.description == description:
|
|
return task
|
|
raise RuntimeError(f"GroupTask with description {description} does not exist")
|
|
|
|
# ANTI AIR
|
|
AAA = ("AAA", GroupRole.AIR_DEFENSE)
|
|
EARLY_WARNING_RADAR = ("EarlyWarningRadar", GroupRole.AIR_DEFENSE)
|
|
LORAD = ("LORAD", GroupRole.AIR_DEFENSE)
|
|
MERAD = ("MERAD", GroupRole.AIR_DEFENSE)
|
|
SHORAD = ("SHORAD", GroupRole.AIR_DEFENSE)
|
|
POINT_DEFENSE = ("PointDefense", GroupRole.AIR_DEFENSE)
|
|
|
|
# NAVAL
|
|
AIRCRAFT_CARRIER = ("AircraftCarrier", GroupRole.NAVAL)
|
|
HELICOPTER_CARRIER = ("HelicopterCarrier", GroupRole.NAVAL)
|
|
NAVY = ("Navy", GroupRole.NAVAL)
|
|
|
|
# GROUND FORCES
|
|
BASE_DEFENSE = ("BaseDefense", GroupRole.GROUND_FORCE)
|
|
FRONT_LINE = ("FrontLine", GroupRole.GROUND_FORCE)
|
|
|
|
# DEFENSES
|
|
COASTAL = ("Coastal", GroupRole.DEFENSES)
|
|
MISSILE = ("Missile", GroupRole.DEFENSES)
|
|
|
|
# BUILDINGS
|
|
ALLY_CAMP = ("AllyCamp", GroupRole.BUILDING)
|
|
AMMO = ("Ammo", GroupRole.BUILDING)
|
|
DERRICK = ("Derrick", GroupRole.BUILDING)
|
|
FACTORY = ("Factory", GroupRole.BUILDING)
|
|
FARP = ("Farp", GroupRole.BUILDING)
|
|
FOB = ("FOB", GroupRole.BUILDING)
|
|
FUEL = ("Fuel", GroupRole.BUILDING)
|
|
OFFSHORE_STRIKE_TARGET = ("OffShoreStrikeTarget", GroupRole.BUILDING)
|
|
OIL = ("Oil", GroupRole.BUILDING)
|
|
|
|
STRIKE_TARGET = ("StrikeTarget", GroupRole.BUILDING)
|
|
VILLAGE = ("Village", GroupRole.BUILDING)
|
|
WARE = ("Ware", GroupRole.BUILDING)
|
|
WW2_BUNKER = ("WW2Bunker", GroupRole.BUILDING)
|
|
|
|
# IADS
|
|
COMMS = ("Comms", GroupRole.BUILDING)
|
|
COMMAND_CENTER = ("CommandCenter", GroupRole.BUILDING)
|
|
POWER = ("Power", GroupRole.BUILDING)
|