mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Move mod vehicle registration to a decorator.
This cruft doesn't need to be in game.db, it can be kept with the mod support code.
This commit is contained in:
21
game/modsupport.py
Normal file
21
game/modsupport.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from typing import Type
|
||||
|
||||
from dcs.helicopters import HelicopterType, helicopter_map
|
||||
from dcs.planes import PlaneType, plane_map
|
||||
from dcs.unittype import VehicleType
|
||||
from dcs.vehicles import vehicle_map
|
||||
|
||||
|
||||
def helicoptermod(helicopter: Type[HelicopterType]) -> Type[HelicopterType]:
|
||||
helicopter_map[helicopter.id] = helicopter
|
||||
return helicopter
|
||||
|
||||
|
||||
def planemod(plane: Type[PlaneType]) -> Type[PlaneType]:
|
||||
plane_map[plane.id] = plane
|
||||
return plane
|
||||
|
||||
|
||||
def vehiclemod(vehicle: Type[VehicleType]) -> Type[VehicleType]:
|
||||
vehicle_map[vehicle.id] = vehicle
|
||||
return vehicle
|
||||
Reference in New Issue
Block a user