mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Cleaning up dead code
This commit is contained in:
parent
274be3bcfc
commit
dec7db9e69
@ -18,7 +18,6 @@ class Operation:
|
|||||||
conflict = None # type: Conflict
|
conflict = None # type: Conflict
|
||||||
armorgen = None # type: ArmorConflictGenerator
|
armorgen = None # type: ArmorConflictGenerator
|
||||||
airgen = None # type: AircraftConflictGenerator
|
airgen = None # type: AircraftConflictGenerator
|
||||||
shipgen = None # type: ShipGenerator
|
|
||||||
triggersgen = None # type: TriggersGenerator
|
triggersgen = None # type: TriggersGenerator
|
||||||
airsupportgen = None # type: AirSupportConflictGenerator
|
airsupportgen = None # type: AirSupportConflictGenerator
|
||||||
visualgen = None # type: VisualGenerator
|
visualgen = None # type: VisualGenerator
|
||||||
@ -65,7 +64,6 @@ class Operation:
|
|||||||
self.current_mission = mission
|
self.current_mission = mission
|
||||||
self.conflict = conflict
|
self.conflict = conflict
|
||||||
self.airgen = AircraftConflictGenerator(mission, conflict, self.game.settings, self.game)
|
self.airgen = AircraftConflictGenerator(mission, conflict, self.game.settings, self.game)
|
||||||
self.shipgen = ShipGenerator(mission, conflict)
|
|
||||||
self.airsupportgen = AirSupportConflictGenerator(mission, conflict, self.game)
|
self.airsupportgen = AirSupportConflictGenerator(mission, conflict, self.game)
|
||||||
self.triggersgen = TriggersGenerator(mission, conflict, self.game)
|
self.triggersgen = TriggersGenerator(mission, conflict, self.game)
|
||||||
self.visualgen = VisualGenerator(mission, conflict, self.game)
|
self.visualgen = VisualGenerator(mission, conflict, self.game)
|
||||||
|
|||||||
@ -3,7 +3,6 @@ from .aircraft import *
|
|||||||
from .armor import *
|
from .armor import *
|
||||||
from .airsupportgen import *
|
from .airsupportgen import *
|
||||||
from .conflictgen import *
|
from .conflictgen import *
|
||||||
from .shipgen import *
|
|
||||||
from .visualgen import *
|
from .visualgen import *
|
||||||
from .triggergen import *
|
from .triggergen import *
|
||||||
from .environmentgen import *
|
from .environmentgen import *
|
||||||
|
|||||||
@ -1,53 +0,0 @@
|
|||||||
import logging
|
|
||||||
|
|
||||||
from game import db
|
|
||||||
from .conflictgen import *
|
|
||||||
from .naming import *
|
|
||||||
|
|
||||||
from dcs.mission import *
|
|
||||||
from dcs.unitgroup import *
|
|
||||||
from dcs.task import *
|
|
||||||
|
|
||||||
SHIP_RANDOM_SPREAD = 300
|
|
||||||
|
|
||||||
|
|
||||||
class ShipGenerator:
|
|
||||||
def __init__(self, mission: Mission, conflict: Conflict):
|
|
||||||
self.m = mission
|
|
||||||
self.conflict = conflict
|
|
||||||
|
|
||||||
def generate_carrier(self, for_units: typing.Collection[UnitType], country: str, at: Point) -> ShipGroup:
|
|
||||||
type = db.find_unittype(Carriage, country)[0]
|
|
||||||
for unit_type in for_units:
|
|
||||||
if unit_type in db.CARRIER_TYPE_BY_PLANE:
|
|
||||||
type = db.CARRIER_TYPE_BY_PLANE[unit_type]
|
|
||||||
break
|
|
||||||
|
|
||||||
group = self.m.ship_group(
|
|
||||||
country=self.m.country(country),
|
|
||||||
name=namegen.next_carrier_name(self.m.country(country)),
|
|
||||||
_type=type,
|
|
||||||
position=at)
|
|
||||||
|
|
||||||
group.points[0].tasks.append(ActivateBeaconCommand(unit_id=group.id, channel=20, callsign="SHDW", aa=False))
|
|
||||||
group.points[0].tasks.append(ActivateICLSCommand(unit_id=group.id, channel=1))
|
|
||||||
return group
|
|
||||||
|
|
||||||
def generate_cargo(self, units: db.ShipDict) -> typing.Collection[ShipGroup]:
|
|
||||||
groups = []
|
|
||||||
offset = 0
|
|
||||||
for unit_type, unit_count in units.items():
|
|
||||||
for _ in range(unit_count):
|
|
||||||
offset += 1
|
|
||||||
logging.info("shipgen: {} ({}) for {}".format(unit_type, unit_count, self.conflict.defenders_side))
|
|
||||||
group = self.m.ship_group(
|
|
||||||
country=self.conflict.defenders_country,
|
|
||||||
name=namegen.next_unit_name(self.conflict.defenders_country, unit_type),
|
|
||||||
_type=unit_type,
|
|
||||||
position=self.conflict.ground_defenders_location.random_point_within(SHIP_RANDOM_SPREAD, SHIP_RANDOM_SPREAD).point_from_heading(0, offset * SHIP_RANDOM_SPREAD)
|
|
||||||
)
|
|
||||||
|
|
||||||
group.add_waypoint(self.conflict.to_cp.position)
|
|
||||||
groups.append(group)
|
|
||||||
|
|
||||||
return groups
|
|
||||||
Loading…
x
Reference in New Issue
Block a user