func (cfg Config) New(b *board.Board) (*Player, error) {
	if err := cfg.validate(); err != nil {
		return nil, fmt.Errorf("creating player: validation: %w", err)
	}
	p := Player{
		WinPoints: cfg.WinPoints,
		Board:     b,
	}
	return &p, nil
}
// New creates a player with the winPoints defined by config and a board to modify.
New creates a player with the winPoints defined by config and a board to modify.
// New creates a player with the winPoints defined by config and a board to modify .
func (cfg Config) New(b *board.Board) (*Player, error) {
	if err := cfg.validate(); err != nil {
		return nil, fmt.Errorf("creating player: validation: %w", err)
	}
	p := Player{
		WinPoints: cfg.WinPoints,
		Board:     b,
	}
	return &p, nil
}
func ( cfg Config ) New ( b * board . Board ) ( * Player , error ) { if err := cfg . validate ( ) ; err != nil { return nil , fmt . Errorf ( " " , err ) } p := Player { WinPoints : cfg . WinPoints , Board : b , } return & p , nil }
New creates a player with the winPoints defined by config and a board to modify.
New creates a player with the winPoints defined by config and a board to modify .