feat: status api
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package rest
|
||||
|
||||
type Status struct {
|
||||
Turn uint `json:"turn"`
|
||||
Players int `json:"players"`
|
||||
}
|
||||
Reference in New Issue
Block a user