File Coverage

blib/lib/Game/Cribbage/Rounds.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package Game::Cribbage::Rounds;
2              
3 5     5   37 use strict;
  5         10  
  5         231  
4 5     5   27 use warnings;
  5         11  
  5         278  
5              
6 5     5   31 use Rope;
  5         12  
  5         36  
7 5     5   2009 use Rope::Autoload;
  5         9  
  5         35  
8 5     5   2660 use Game::Cribbage::Round;
  5         19  
  5         1397  
9              
10             property number => (
11             initable => 1,
12             writeable => 0,
13             configurable => 0,
14             enumerable => 1
15             );
16              
17             property history => (
18             initable => 1,
19             writeable => 1,
20             configurable => 0,
21             enumerable => 1,
22             value => []
23             );
24              
25             property current_round => (
26             initable => 1,
27             writeable => 1,
28             configurable => 0,
29             enumerable => 1,
30             );
31              
32             function next_round => sub {
33             my ($self, $game, %args) = @_;
34             if (scalar @{$self->history} >= $self->number) {
35             die 'DISPLAY THE RESULT FOR THE GAME';
36             }
37             my $round = Game::Cribbage::Round->new(
38             _game => $game,
39             number => scalar @{$self->history} + 1,
40             %args
41             );
42             push @{$self->history}, $round;
43             $self->current_round = $round;
44             return $self;
45             };
46              
47             1;