35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package serve
|
|
|
|
// Game is the JSON DTO for a game.
|
|
type Game struct {
|
|
// Players is the players in the game.
|
|
// The dealer is always the first player.
|
|
Players [2]Player `json:"players"`
|
|
// Round is the current round.
|
|
Round uint `json:"round"`
|
|
// Damage is the damage a live shell will deal this turn.
|
|
Damage int8 `json:"damage"`
|
|
// Shell gives whether the current shell is live if it is revealed.
|
|
// Undefined if this game state is not for the current player or if the
|
|
// current player hasn't revealed it.
|
|
Shell *bool `json:"shell,omitempty"`
|
|
// Previous gives whether the previously discharged shell was live.
|
|
Previous *bool `json:"previous"`
|
|
}
|
|
|
|
// Player is the JSON DTO for a player.
|
|
type Player struct {
|
|
// HP is the player's current health.
|
|
HP int8 `json:"hp"`
|
|
// Items is the player's items.
|
|
Items []string `json:"items,omitempty"`
|
|
// Cuffs is whether the player is currently wearing cuffs.
|
|
Cuffs bool `json:"cuffs,omitempty"`
|
|
}
|
|
|
|
// ShellCounts is the JSON DTO for shell counts emitted at the start of a round.
|
|
type ShellCounts struct {
|
|
Live int `json:"live"`
|
|
Blank int `json:"blank"`
|
|
}
|