take game id to start a new game instead of generating

This commit is contained in:
Branden J Brown 2024-01-21 13:55:59 -06:00
parent 7707d0bb5b
commit 5e595711d4
1 changed files with 1 additions and 4 deletions

View File

@ -3,8 +3,6 @@ package lobby
import (
"sync"
"github.com/google/uuid"
"git.sunturtle.xyz/studio/shotgun/game"
"git.sunturtle.xyz/studio/shotgun/player"
"git.sunturtle.xyz/studio/shotgun/serve"
@ -35,8 +33,7 @@ func (l *Lobby) Game(id GameID) *game.Game {
// Start begins a new game in the lobby.
// The caller must be able to distinguish the dealer's and challenger's conns
// in order to provide correct game start DTOs to each.
func (l *Lobby) Start(dealer, challenger player.ID) GameID {
id := uuid.New()
func (l *Lobby) Start(id GameID, dealer, challenger player.ID) GameID {
g := game.New(dealer, challenger)
l.mu.Lock()
defer l.mu.Unlock()