feat: status api

This commit is contained in:
Ilia Denisov
2026-01-07 18:38:06 +02:00
parent 1b0ab7a079
commit 204d3df8cf
20 changed files with 188 additions and 40 deletions
+5
View File
@@ -122,6 +122,11 @@ func (g Game) deleteShipTypeInternal(ri int, name string) error {
}); pl >= 0 {
return e.NewDeleteShipTypePlanetProductionError(g.Map.Planet[pl].Name)
}
for sg := range g.listShipGroups(ri) {
if sg.TypeID == g.Race[ri].ShipTypes[st].ID {
return e.NewDeleteShipTypeExistingGroupError("group: %v", sg.Index)
}
}
g.Race[ri].ShipTypes = append(g.Race[ri].ShipTypes[:st], g.Race[ri].ShipTypes[st+1:]...)
return nil
}
+6
View File
@@ -0,0 +1,6 @@
package rest
type Status struct {
Turn uint `json:"turn"`
Players int `json:"players"`
}