take game id to start a new game instead of generating
This commit is contained in:
parent
7707d0bb5b
commit
5e595711d4
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user