RndName 5cdfe62e2d Implement advanced skynet functions
- factor out own class for the iadsnetwork within the conflicttheater
- This class will handle all Skynet related things - no specific group_name handling necessary in future
- make iadsbuilding own TGO class because SAM & EWRs are Vehicle Groups. IADS Elements dont have any groups attached.
- added command center, connection node and power source as Ground objects which can be added by the campaign designer
- adjust lua generator to support new iads units
- parse the campaign yaml to get the iads network information
- use the range as fallback if no yaml information was found
- complete rewrite of the skynet lua script
- allow destruction of iads network to be persistent over all rounds
- modified the presetlocation handling: the wrapper PresetLocation for PointWithHeading now stores the original name from the campaign miz to have the ability to process campaign yaml configurations based on the ground unit
- Implementation of the UI representation for the IADS Network
- Give user the option to enable or disable advanced iads
- Extended the layout system: Implement Sub task handling to support PD
2022-04-19 10:41:16 +02:00

27 lines
806 B
Python

from uuid import UUID
from fastapi import APIRouter, Depends
from game import Game
from .models import IadsConnectionJs, IadsNetworkJs
from ..dependencies import GameContext
router: APIRouter = APIRouter(prefix="/iads-network")
@router.get("/", operation_id="get_iads_network", response_model=IadsNetworkJs)
def get_iads_network(
game: Game = Depends(GameContext.require),
) -> IadsNetworkJs:
return IadsNetworkJs.from_network(game.theater.iads_network)
@router.get(
"/for-tgo/{tgo_id}",
operation_id="get_iads_connections_for_tgo",
response_model=list[IadsConnectionJs],
)
def get_iads_connections_for_tgo(
tgo_id: UUID, game: Game = Depends(GameContext.require)
) -> list[IadsConnectionJs]:
return IadsConnectionJs.connections_for_tgo(tgo_id, game.theater.iads_network)