Cribbage/Rounds.pm

filter: Statementstmt 96.1% 25 / 26 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 94.1% 32 / 34 CC 2 SCAR 2.9
CC
2
Cov
93%
next_round
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Cribbage/Deck/Card.pm ↑ Summary Cribbage.pm »
1 package Game::Cribbage::Rounds;
2  
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 11 ▶use Object::Proto::Sugar -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 11 ▶use Game::Cribbage::Round;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 has number => (
10 is => 'ro',
11 isa => Int
12 11 );
13  
14 has history => (
15 is => 'rw',
16 isa => ArrayRef,
17 default => []
18 11 );
19  
20 has current_round => (
21 is => 'rw',
22 isa => Object,
23 11 );
24  
25 62 ▶sub next_round {
Subroutine next_round: called CC=2 SCAR=7.0
Pod documented
26 62 my ($self, $game, %args) = @_;
27 62 ▶ if (scalar @{$self->history} >= $self->number) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @{$self->history;} >= $self->number) 0 62 62
28 0 die 'DISPLAY THE RESULT FOR THE GAME';
29 }
30 my $round = Game::Cribbage::Round->new(
31 62 number => scalar @{$self->history} + 1,
32 %args
33 )->init($game);
34 62 push @{$self->history}, $round;
35 62 $self->current_round($round);
36 62 return $self;
37 }
38  
39 11 1;
40  
41 __END__
« Cribbage/Deck/Card.pm ↑ Summary Cribbage.pm »