32 lines
914 B
Go
32 lines
914 B
Go
package rest
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
type StateResponse struct {
|
|
// 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"`
|
|
// Finished is true on the turn-generation response that ends the
|
|
// game; otherwise false. Game Master uses this as the sole signal to
|
|
// run the platform finish flow.
|
|
Finished bool `json:"finished"`
|
|
}
|
|
|
|
type PlayerState struct {
|
|
// 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"`
|
|
}
|