func (cfg Config) NewLobby(log log.Logger, socketRunner SocketRunner, gameRunner GameRunner) (*Lobby, error) {
	if err := cfg.validate(log, socketRunner, gameRunner); err != nil {
		return nil, fmt.Errorf("creating lobby: validation: %w", err)
	}
	l := Lobby{
		log:            log,
		socketRunner:   socketRunner,
		gameRunner:     gameRunner,
		socketMessages: make(chan message.Socket),
		games:          make(map[game.ID]game.Info),
		Config:         cfg,
	}
	return &l, nil
}
// NewLobby creates a new game lobby.
NewLobby creates a new game lobby.
// NewLobby creates a new game lobby .
func (cfg Config) NewLobby(log log.Logger, socketRunner SocketRunner, gameRunner GameRunner) (*Lobby, error) {
	if err := cfg.validate(log, socketRunner, gameRunner); err != nil {
		return nil, fmt.Errorf("creating lobby: validation: %w", err)
	}
	l := Lobby{
		log:            log,
		socketRunner:   socketRunner,
		gameRunner:     gameRunner,
		socketMessages: make(chan message.Socket),
		games:          make(map[game.ID]game.Info),
		Config:         cfg,
	}
	return &l, nil
}
func ( cfg Config ) NewLobby ( log log . Logger , socketRunner SocketRunner , gameRunner GameRunner ) ( * Lobby , error ) { if err := cfg . validate ( log , socketRunner , gameRunner ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } l := Lobby { log : log , socketRunner : socketRunner , gameRunner : gameRunner , socketMessages : make ( chan message . Socket ) , games : make ( map [ game . ID ] game . Info ) , Config : cfg , } return & l , nil }
NewLobby creates a new game lobby.
NewLobby creates a new game lobby .