Game/FiveCardDraw.pm

filter: Statementstmt 100% 31 / 31 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 82.6% 43 / 52 CC 4 SCAR 8.1
CC
4
Cov
87%
__ANON__
4.7
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« Game/Badugi.pm ↑ Summary Game/Low27TripleDraw.pm »
1 package Poker::Game::FiveCardDraw;
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::Eval::Community;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Poker::Score::High;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 NAME
12  
13 Poker::Game::FiveCardDraw - Five-card draw (high)
14  
15 =head1 VERSION
16  
17 Version 0.12
18  
19 =cut
20  
21  
22 =head1 SYNOPSIS
23  
24 use Poker::Game::FiveCardDraw;
25  
26 my $game = Poker::Game::FiveCardDraw->new;
27 my $hero = $game->deal_hole(['As','Kd','7c','2h','9s']);
28 $game->discard($hero, ['7c','2h']);
29 $game->draw($hero); # refill to 5
30 $game->evaluate($hero);
31  
32 =head1 DESCRIPTION
33  
34 Five-card draw highball. One discard/draw round. No community cards.
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 1 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=4 SCAR=15.5
45 1 my ( $orig, $class, @args ) = @_;
46 1 my $args = $class->$orig(@args);
47 1 ▶ $args = {} unless ref $args eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $args eq "HASH" 0 1 1
48 1 ▶ $args->{scorer} //= Poker::Score::High->new;
Condition33%1/3
$args->{"scorer"} //= "Poker::Score::High"->new
l!l&&r!l&&!r
010
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
ABresult
1X1
011
000
49 $args->{eval_engine} //= Poker::Eval::Community->new(
50 scorer => $args->{scorer},
51 1 ▶ );
Condition33%1/3
$args->{"eval_engine"} //= "Poker::Eval::Community"->new("scorer", $args->{"scorer"})
l!l&&r!l&&!r
010
MC/DC0%0/2
$args->{"eval_engine"} //= "Poker::Eval::Community"->new("scorer", $args->{"scorer"})
$args->{"eval_engine"} "Poker::Eval::Community"->new("scorer", $args->{"scorer"})
Truth table33%1/3
A //= B
A= $args->{"eval_engine"}B= "Poker::Eval::Community"->new("scorer", $args->{"scorer"})
ABresult
1X1
011
000
52 1 return $args;
53 1 };
54  
55 1 1;
« Game/Badugi.pm ↑ Summary Game/Low27TripleDraw.pm »