line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Suit; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.013'; |
4
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
1303
|
use Acme::Mitey::Cards::Mite qw( -all ); |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
32
|
|
7
|
5
|
|
|
5
|
|
1055
|
use Acme::Mitey::Cards::Types qw( :types ); |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
3031
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has name => ( |
10
|
|
|
|
|
|
|
is => ro, |
11
|
|
|
|
|
|
|
isa => NonEmptyStr, |
12
|
|
|
|
|
|
|
required => true, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has abbreviation => ( |
16
|
|
|
|
|
|
|
is => lazy, |
17
|
|
|
|
|
|
|
isa => Str, |
18
|
12
|
|
|
12
|
|
55
|
builder => sub { uc substr( shift->name, 0, 1 ) }, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has colour => ( |
22
|
|
|
|
|
|
|
is => ro, |
23
|
|
|
|
|
|
|
isa => Str, |
24
|
|
|
|
|
|
|
required => true, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
{ |
28
|
|
|
|
|
|
|
my ( $hearts, $diamonds, $spades, $clubs ); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
signature_for $_ => ( pos => [] ) |
31
|
|
|
|
|
|
|
for qw( hearts diamonds spades clubs ); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub hearts { |
35
|
|
|
|
|
|
|
$hearts ||= Acme::Mitey::Cards::Suit->new( name => 'Hearts', colour => 'red' ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub diamonds { |
39
|
|
|
|
|
|
|
$diamonds ||= Acme::Mitey::Cards::Suit->new( name => 'Diamonds', colour => 'red' ); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub spades { |
43
|
|
|
|
|
|
|
$spades ||= Acme::Mitey::Cards::Suit->new( name => 'Spades', colour => 'black' ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub clubs { |
47
|
|
|
|
|
|
|
$clubs ||= Acme::Mitey::Cards::Suit->new( name => 'Clubs', colour => 'black' ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
signature_for standard_suits => ( |
52
|
|
|
|
|
|
|
pos => [], |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub standard_suits { |
56
|
|
|
|
|
|
|
my $class = shift; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
return ( |
59
|
|
|
|
|
|
|
$class->spades, |
60
|
|
|
|
|
|
|
$class->hearts, |
61
|
|
|
|
|
|
|
$class->diamonds, |
62
|
|
|
|
|
|
|
$class->clubs, |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1; |