move game id to live among the dtos

This commit is contained in:
Branden J Brown 2024-01-21 12:28:46 -06:00
parent 24af4b7602
commit 98a45e2680
2 changed files with 13 additions and 3 deletions

View File

@ -3,12 +3,11 @@ package lobby
import ( import (
"sync" "sync"
"github.com/google/uuid"
"git.sunturtle.xyz/studio/shotgun/game" "git.sunturtle.xyz/studio/shotgun/game"
"git.sunturtle.xyz/studio/shotgun/serve"
) )
type GameID = uuid.UUID type GameID = serve.GameID
// Lobby is a set of active games. // Lobby is a set of active games.
type Lobby struct { type Lobby struct {

View File

@ -1,5 +1,7 @@
package serve package serve
import "github.com/google/uuid"
// Game is the JSON DTO for a game. // Game is the JSON DTO for a game.
type Game struct { type Game struct {
// Players is the players in the game. // Players is the players in the game.
@ -27,6 +29,15 @@ type Player struct {
Cuffs bool `json:"cuffs,omitempty"` Cuffs bool `json:"cuffs,omitempty"`
} }
type GameID = uuid.UUID
// GameStart is the JSON DTO given to each player when their game starts.
// Observers do not receive it.
type GameStart struct {
ID GameID `json:"id"`
Dealer bool `json:"dealer"`
}
// ShellCounts is the JSON DTO for shell counts emitted at the start of a round. // ShellCounts is the JSON DTO for shell counts emitted at the start of a round.
type ShellCounts struct { type ShellCounts struct {
Live int `json:"live"` Live int `json:"live"`