game stats shows planes and population
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package rest
|
||||
|
||||
type Init struct {
|
||||
Races []Race `json:"races" binding:"required,gte=10"`
|
||||
type InitRequest struct {
|
||||
// List of the Races in the Game
|
||||
Races []InitRace `json:"races" binding:"required,gte=10"`
|
||||
}
|
||||
|
||||
type Race struct {
|
||||
Name string `json:"name" binding:"required,notblank"`
|
||||
type InitRace struct {
|
||||
// Name of the Race
|
||||
RaceName string `json:"raceName" binding:"required,notblank"`
|
||||
}
|
||||
|
||||
@@ -3,14 +3,25 @@ package rest
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type StateResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Turn uint `json:"turn"`
|
||||
Stage uint `json:"stage"`
|
||||
// Unique Game ID
|
||||
ID uuid.UUID `json:"id"`
|
||||
// Current Game Turn
|
||||
Turn uint `json:"turn"`
|
||||
// Turn stage (for games that support stste modification)
|
||||
Stage uint `json:"stage"`
|
||||
// List of Game's players
|
||||
Players []PlayerState `json:"player"`
|
||||
}
|
||||
|
||||
type PlayerState struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Extinct bool `json:"extinct"`
|
||||
// Unique Player ID within Game
|
||||
ID uuid.UUID `json:"id"`
|
||||
// Player's Race name
|
||||
RaceName string `json:"raceName"`
|
||||
// Number of planets owned by player
|
||||
Planets uint `json:"planets"`
|
||||
// Total population summ from all player's planets
|
||||
Population float64 `json:"population"`
|
||||
// True when Race is eliminated or left the game
|
||||
Extinct bool `json:"extinct"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user