mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
carrier operations WIP
This commit is contained in:
@@ -53,7 +53,7 @@ class AircraftConflictGenerator:
|
||||
country=side,
|
||||
name=name,
|
||||
aircraft_type=unit_type,
|
||||
airport=airport,
|
||||
airport=self.m.terrain.airport_by_id(airport.id),
|
||||
maintask=None,
|
||||
start_type=StartType.Cold,
|
||||
group_size=count,
|
||||
@@ -104,11 +104,11 @@ class AircraftConflictGenerator:
|
||||
return group
|
||||
|
||||
def _generate_group(self, name: str, side: Country, unit_type: FlyingType, count: int, client_count: int, at: db.StartingPosition):
|
||||
if type(at) == Point:
|
||||
if isinstance(at, Point):
|
||||
return self._generate_inflight(name, side, unit_type, count, client_count, at)
|
||||
elif type(at) == Airport:
|
||||
elif issubclass(at, Airport):
|
||||
return self._generate_at_airport(name, side, unit_type, count, client_count, at)
|
||||
elif type(at) == ShipGroup:
|
||||
elif isinstance(at, ShipGroup):
|
||||
return self._generate_at_carrier(name, side, unit_type, count, client_count, at)
|
||||
else:
|
||||
assert False
|
||||
|
||||
@@ -19,14 +19,13 @@ from dcs.task import *
|
||||
|
||||
|
||||
class ShipGenerator:
|
||||
def __init__(self, mission: Mission, conflict: Conflict, position: Point):
|
||||
def __init__(self, mission: Mission, conflict: Conflict):
|
||||
self.m = mission
|
||||
self.conflict = conflict
|
||||
self.position = position
|
||||
|
||||
def generate(self):
|
||||
self.m.ship_group(
|
||||
def generate(self, at: Point) -> ShipGroup:
|
||||
return self.m.ship_group(
|
||||
country=self.conflict.attackers_side,
|
||||
name=namegen.next_transport_group_name(),
|
||||
_type=dcs.ships.CVN_74_John_C__Stennis,
|
||||
position=self.position)
|
||||
position=at)
|
||||
|
||||
Reference in New Issue
Block a user