| 1 | package Poker::Game::FiveCardDrawJokersWild; | ||||||||||||||||||||
| 2 | 1 | our $VERSION = '0.12'; | |||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use warnings FATAL => 'all'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 1 | ▶ | use Moo; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use Poker::Dealer; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use Poker::Eval::Wild; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 1 | ▶ | use Poker::Score::High; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | =head1 NAME | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | Poker::Game::FiveCardDrawJokersWild - Five-card draw with jokers wild | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | =head1 VERSION | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | Version 0.12 | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | =cut | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | =head1 SYNOPSIS | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | use Poker::Game::FiveCardDrawJokersWild; | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | my $game = Poker::Game::FiveCardDrawJokersWild->new; | ||||||||||||||||||||
| 28 | my $hero = $game->deal_hole(['As', 'Kd', 'Jo1', '2h', '9s']); | ||||||||||||||||||||
| 29 | $game->evaluate($hero); | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | =head1 DESCRIPTION | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | Five-card draw using a 54-card deck (two jokers). Jokers are always | ||||||||||||||||||||
| 34 | wild. Deal jokers by name as C<Jo1> / C<Jo2>. | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | =cut | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 1 | extends 'Poker::Game'; | |||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 1 | ▶ | has '+hole_count' => ( default => sub { 5 } ); | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 41 | 1 | ▶ | has '+board_size' => ( default => sub { 0 } ); | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 42 | 1 | ▶ | has '+max_draw_rounds' => ( default => sub { 1 } ); | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | has 'joker_count' => ( | ||||||||||||||||||||
| 45 | is => 'ro', | ||||||||||||||||||||
| 46 | 1 | ▶ | default => sub { 2 }, | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 47 | 1 | ); | |||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 1 | ▶ | around BUILDARGS => sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=18.1
| |||||||||||||||||||||
| 50 | 1 | my ( $orig, $class, @args ) = @_; | |||||||||||||||||||
| 51 | 1 | my $args = $class->$orig(@args); | |||||||||||||||||||
| 52 | 1 | ▶ | $args = {} unless ref $args eq 'HASH'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 1 | ▶ | my $jokers = $args->{joker_count} // 2; | ||||||||||||||||||
|
Condition50%1/2
$args->{"joker_count"} // 2
MC/DC0%0/1
$args->{"joker_count"} // 2
$args->{"joker_count"}
Truth table50%1/2
A
A= $args->{"joker_count"}
| |||||||||||||||||||||
| 55 | 1 | ▶ | $args->{scorer} //= Poker::Score::High->new; | ||||||||||||||||||
|
Condition33%1/3
$args->{"scorer"} //= "Poker::Score::High"->new
MC/DC0%0/2
$args->{"scorer"} //= "Poker::Score::High"->new
$args->{"scorer"}
"Poker::Score::High"->new
Truth table33%1/3
A //= B
A= $args->{"scorer"}B= "Poker::Score::High"->new
| |||||||||||||||||||||
| 56 | $args->{eval_engine} //= Poker::Eval::Wild->new( | ||||||||||||||||||||
| 57 | scorer => $args->{scorer}, | ||||||||||||||||||||
| 58 | 1 | ▶ | dealer => Poker::Dealer->new( joker_count => $jokers ), | ||||||||||||||||||
|
Condition33%1/3
$args->{"eval_engine"} //= "Poker::Eval::Wild"->new("scorer", $args->{"scorer"}, "dealer", "Poker::Dealer"->new("joker_count", $jokers))
MC/DC0%0/2
$args->{"eval_engine"} //= "Poker::Eval::Wild"->new("scorer", $args->{"scorer"}, "dealer", "Poker::Dealer"->new("joker_count", $jokers))
$args->{"eval_engine"}
"Poker::Eval::Wild"->new("scorer", $args->{"scorer"}, "dealer", "Poker::Dealer"->new("joker_count", $jokers))
Truth table33%1/3
A //= B
A= $args->{"eval_engine"}B= "Poker::Eval::Wild"->new("scorer", $args->{"scorer"}, "dealer", "Poker::Dealer"->new("joker_count", $jokers))
| |||||||||||||||||||||
| 59 | ); | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | 1 | return $args; | |||||||||||||||||||
| 62 | 1 | }; | |||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | 1 | 1; | |||||||||||||||||||