mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Move a type out of game.db.
This commit is contained in:
parent
e3ee988225
commit
c1cb32de21
@ -1,13 +1,12 @@
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
from typing import Optional, Type, Union
|
||||
from typing import Optional, Type
|
||||
|
||||
from dcs.countries import country_dict
|
||||
from dcs.helicopters import (
|
||||
OH_58D,
|
||||
helicopter_map,
|
||||
)
|
||||
from dcs.mapping import Point
|
||||
|
||||
# mypy can't resolve these if they're wildcard imports for some reason.
|
||||
from dcs.planes import (
|
||||
@ -29,8 +28,6 @@ from dcs.ships import (
|
||||
Stennis,
|
||||
ship_map,
|
||||
)
|
||||
from dcs.terrain.terrain import Airport
|
||||
from dcs.unitgroup import ShipGroup, StaticGroup
|
||||
from dcs.unittype import FlyingType, ShipType, UnitType, VehicleType
|
||||
from dcs.vehicles import (
|
||||
vehicle_map,
|
||||
@ -150,8 +147,6 @@ REWARDS = {
|
||||
---------- END OF CONFIGURATION SECTION
|
||||
"""
|
||||
|
||||
StartingPosition = Union[ShipGroup, StaticGroup, Airport, Point]
|
||||
|
||||
|
||||
def upgrade_to_supercarrier(unit: Type[ShipType], name: str) -> Type[ShipType]:
|
||||
if unit == Stennis:
|
||||
|
||||
@ -27,6 +27,7 @@ from dcs.mapping import Point
|
||||
from dcs.ships import Forrestal, KUZNECOW, LHA_Tarawa, Stennis, Type_071
|
||||
from dcs.terrain.terrain import Airport, ParkingSlot
|
||||
from dcs.unit import Unit
|
||||
from dcs.unitgroup import ShipGroup, StaticGroup
|
||||
|
||||
from game import db
|
||||
from game.point_with_heading import PointWithHeading
|
||||
@ -271,6 +272,9 @@ class ControlPointStatus(IntEnum):
|
||||
Destroyed = auto()
|
||||
|
||||
|
||||
StartingPosition = ShipGroup | StaticGroup | Airport | Point
|
||||
|
||||
|
||||
class ControlPoint(MissionTarget, ABC):
|
||||
# Not sure what distance DCS uses, but assuming it's about 2NM since that's roughly
|
||||
# the distance of the circle on the map.
|
||||
@ -291,7 +295,7 @@ class ControlPoint(MissionTarget, ABC):
|
||||
cp_id: int,
|
||||
name: str,
|
||||
position: Point,
|
||||
at: db.StartingPosition,
|
||||
at: StartingPosition,
|
||||
starts_blue: bool,
|
||||
has_frontline: bool = True,
|
||||
cptype: ControlPointType = ControlPointType.AIRBASE,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user