lib/VANAMBURG/SHoCkeDOrder.pm

filter: Statementstmt 93.3% 14 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 3 / 3 totaltotal 91.6% 22 / 24 CC 1 SCAR 1.5
CC
1
Cov
93%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« lib/VANAMBURG/SuitSingleton.pm ↑ Summary lib/VANAMBURG/SuitSingletonCHaSeD.pm »
1 package VANAMBURG::SHoCkeDOrder;
2 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use VANAMBURG::SuitSingletonSHoCkeD;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5  
6 =head1 VANAMBURG::SHoCkeDPacket
7  
8 An role provides extension of VANAMBURG::Packet that provides methods for useful for
9 stacks in SHoCKeD order.
10  
11 =cut
12  
13 =head2 suit_cycle
14  
15 my $arrayref = $packet->suit_cycle;
16
17 Returns an array reference of 4 VANAMBURG::OrderedSuit objects
18 representing the order of suits in a SHoCkeD stack.
19  
20 This is a short cut to accessing VANAMBURG::SuitSingletonSHoCkeD::suit_cycle.
21  
22 =cut
23  
24 has 'suit_cycle' => (
25 is => 'ro',
26 lazy => 1,
27 isa => 'ArrayRef[VANAMBURG::Suit]',
28 0 ▶ default => sub {VANAMBURG::SuitSingletonSHoCkeD->instance->suit_cycle}
Subroutine __ANON__: not called CC=1 SCAR=6.9
29 3 );
30  
31 =head2 opposite_suit
32  
33 Returns the mate of the card passed as input.
34  
35 my $heart = $packet->opposite_suit(VANAMBURG::SuitSingletonSHoCkeD->instance->diamond);
36  
37 This is a shortcut to VANAMBURG::SuitSingletonSHoCkeD::opposite_suit
38  
39 =cut
40  
41 24 ▶sub opposite_suit {
Subroutine opposite_suit: called CC=1 SCAR=0.0
Pod documented
42 24 my ( $self, $suit ) = @_;
43 24 return VANAMBURG::SuitSingletonSHoCkeD->instance->opposite_suit($suit);
44 }
45  
46 =head2 next_suit
47  
48 Returns the suit following the input suit for a SHoCkeD packet.
49  
50 my $heart = $packet->next_suit(VANAMBURG::SuitSingletonSHoCkeD->instance->spade);
51 my $spade = $packet->next_suit(VANAMBURG::SuitSingletonSHoCkeD->instance->diamond);
52
53 This is a short cut to VANAMBURG::SuitSingletonSHoCkeD::next_suit
54
55 =cut
56  
57 32 ▶sub next_suit {
Subroutine next_suit: called CC=1 SCAR=0.0
Pod documented
58 32 my ( $self, $suit ) = @_;
59 32 return VANAMBURG::SuitSingletonSHoCkeD->instance->next_suit($suit);
60 }
61  
62 =head2 previous_suit
63  
64 Returns the suit preceding the input suit for a SHoCkeD packet.
65  
66 my $heart = $packet->next_suit(VANAMBURG::SuitSingletonSHoCkeD->instance->club);
67 my $diamond = $packet->next_suit(VANAMBURG::SuitSingletonSHoCkeD->instance->spade);
68
69 This is a short cut to VANAMBURG::SuitSingletonSHoCkeD::previous_suit
70
71 =cut
72  
73 24 ▶sub previous_suit {
Subroutine previous_suit: called CC=1 SCAR=0.0
Pod documented
74 24 my ( $self, $suit ) = @_;
75 24 return VANAMBURG::SuitSingletonSHoCkeD->instance->previous_suit($suit);
76 }
77  
78 3 1;
« lib/VANAMBURG/SuitSingleton.pm ↑ Summary lib/VANAMBURG/SuitSingletonCHaSeD.pm »