mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
No threat/detection circles yet. https://github.com/dcs-liberation/dcs_liberation/issues/2039
18 lines
489 B
Python
18 lines
489 B
Python
from fastapi import APIRouter, Depends
|
|
|
|
from game import Game
|
|
from .models import TgoJs
|
|
from ..dependencies import GameContext
|
|
|
|
router: APIRouter = APIRouter(prefix="/tgos")
|
|
|
|
|
|
@router.get("/")
|
|
def list_tgos(game: Game = Depends(GameContext.get)) -> list[TgoJs]:
|
|
tgos = []
|
|
for control_point in game.theater.controlpoints:
|
|
for tgo in control_point.connected_objectives:
|
|
if not tgo.is_control_point:
|
|
tgos.append(TgoJs.for_tgo(tgo))
|
|
return tgos
|