mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
16 lines
482 B
Python
16 lines
482 B
Python
from fastapi import APIRouter, Depends
|
|
|
|
from game import Game
|
|
from .models import ControlPointJs
|
|
from ..dependencies import GameContext
|
|
|
|
router: APIRouter = APIRouter(prefix="/control-points")
|
|
|
|
|
|
@router.get("/")
|
|
def list_control_points(game: Game = Depends(GameContext.get)) -> list[ControlPointJs]:
|
|
control_points = []
|
|
for control_point in game.theater.controlpoints:
|
|
control_points.append(ControlPointJs.for_control_point(control_point))
|
|
return control_points
|