mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
This class does far too many things and the file is huge. Split it up into a few more classes.
26 lines
710 B
Python
26 lines
710 B
Python
import logging
|
|
|
|
from dcs.point import MovingPoint
|
|
from dcs.task import BombingRunway
|
|
|
|
from game.theater import Airfield
|
|
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
|
|
|
|
|
class OcaRunwayIngressBuilder(PydcsWaypointBuilder):
|
|
def build(self) -> MovingPoint:
|
|
waypoint = super().build()
|
|
|
|
target = self.package.target
|
|
if not isinstance(target, Airfield):
|
|
logging.error(
|
|
"Unexpected target type for runway bombing mission: %s",
|
|
target.__class__.__name__,
|
|
)
|
|
return waypoint
|
|
|
|
waypoint.tasks.append(
|
|
BombingRunway(airport_id=target.airport.id, group_attack=True)
|
|
)
|
|
return waypoint
|