From 98a45e2680c5b5c23b0fe3423e85ba593474770d Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sun, 21 Jan 2024 12:28:46 -0600 Subject: [PATCH] move game id to live among the dtos --- lobby/lobby.go | 5 ++--- serve/dto.go | 11 +++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lobby/lobby.go b/lobby/lobby.go index 8189a29..e352676 100644 --- a/lobby/lobby.go +++ b/lobby/lobby.go @@ -3,12 +3,11 @@ package lobby import ( "sync" - "github.com/google/uuid" - "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. type Lobby struct { diff --git a/serve/dto.go b/serve/dto.go index 770fb8b..2fab01f 100644 --- a/serve/dto.go +++ b/serve/dto.go @@ -1,5 +1,7 @@ package serve +import "github.com/google/uuid" + // Game is the JSON DTO for a game. type Game struct { // Players is the players in the game. @@ -27,6 +29,15 @@ type Player struct { 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. type ShellCounts struct { Live int `json:"live"`