File Coverage

blib/lib/Poker/Eval/HighSuit.pm
Criterion Covered Total %
statement 3 8 37.5
branch n/a
condition n/a
subroutine 1 3 33.3
pod 1 1 100.0
total 5 12 41.6


line stmt bran cond sub pod time code
1             package Poker::Eval::HighSuit;
2 1     1   569 use Moo;
  1         1  
  1         4  
3              
4             =head1 NAME
5              
6             Poker::Eval::HighSuit - Calculate the highest card of a specific suit.
7              
8             =head1 VERSION
9              
10             Version 0.02
11              
12             =cut
13              
14             our $VERSION = '0.02';
15              
16              
17             =head1 INTRODUCTION
18              
19             Useful in split-pot games like High Chicago where half the pot goes to the player with the highest Spade.
20              
21             =cut
22              
23             extends 'Poker::Eval';
24              
25             has 'high_suit' => (
26             is => 'rw',
27             builder => '_build_high_suit',
28             );
29              
30             sub _build_high_suit { # High Chicago
31 0     0     return 's';
32             }
33              
34             sub best_hand {
35 0     0 1   my ( $self, $hole ) = @_;
36 0           my $hand = Poker::Hand->new(cards => $hole);
37 0           $hand->score($self->scorer->score($hole, $self->high_suit));
38 0           return $hand;
39             }
40              
41             =head1 AUTHOR
42              
43             Nathaniel Graham, C<< >>
44              
45             =head1 LICENSE AND COPYRIGHT
46              
47             Copyright 2016 Nathaniel Graham.
48              
49             This program is free software; you can redistribute it and/or modify it
50             under the terms of the the Artistic License (2.0). You may obtain a
51             copy of the full license at:
52              
53             L
54              
55             =cut
56              
57             1;