func (cfg RunnerConfig) NewRunner(log log.Logger, WordValidator WordValidator, userDao UserDao) (*Runner, error) {
	if err := cfg.validate(log, WordValidator, userDao); err != nil {
		return nil, fmt.Errorf("creating game runner: validation: %w", err)
	}
	m := Runner{
		log:           log,
		games:         make(map[game.ID]chan<- message.Message, cfg.MaxGames),
		RunnerConfig:  cfg,
		WordValidator: WordValidator,
		userDao:       userDao,
	}
	return &m, nil
}
// NewRunner creates a new game runner from the config.
NewRunner creates a new game runner from the config.
// NewRunner creates a new game runner from the config .
func (cfg RunnerConfig) NewRunner(log log.Logger, WordValidator WordValidator, userDao UserDao) (*Runner, error) {
	if err := cfg.validate(log, WordValidator, userDao); err != nil {
		return nil, fmt.Errorf("creating game runner: validation: %w", err)
	}
	m := Runner{
		log:           log,
		games:         make(map[game.ID]chan<- message.Message, cfg.MaxGames),
		RunnerConfig:  cfg,
		WordValidator: WordValidator,
		userDao:       userDao,
	}
	return &m, nil
}
func ( cfg RunnerConfig ) NewRunner ( log log . Logger , WordValidator WordValidator , userDao UserDao ) ( * Runner , error ) { if err := cfg . validate ( log , WordValidator , userDao ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } m := Runner { log : log , games : make ( map [ game . ID ] chan <- message . Message , cfg . MaxGames ) , RunnerConfig : cfg , WordValidator : WordValidator , userDao : userDao , } return & m , nil }
NewRunner creates a new game runner from the config.
NewRunner creates a new game runner from the config .