line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Hand; |
4
|
4
|
|
|
4
|
|
30
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
140
|
|
5
|
4
|
|
|
4
|
|
24
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
113
|
|
6
|
4
|
|
|
4
|
|
22
|
no warnings qw( once void ); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
509
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
9
|
|
|
|
|
|
|
our $MITE_SHIM = "Acme::Mitey::Cards::Mite"; |
10
|
|
|
|
|
|
|
our $MITE_VERSION = "0.011000"; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Mite keywords |
13
|
|
|
|
|
|
|
BEGIN { |
14
|
4
|
|
|
4
|
|
22
|
my ( $SHIM, $CALLER ) = |
15
|
|
|
|
|
|
|
( "Acme::Mitey::Cards::Mite", "Acme::Mitey::Cards::Hand" ); |
16
|
|
|
|
|
|
|
( |
17
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
18
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
19
|
|
|
|
|
|
|
) |
20
|
4
|
|
|
|
|
10
|
= do { |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
23
|
4
|
|
|
4
|
|
30
|
no warnings 'redefine'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
891
|
|
24
|
|
|
|
|
|
|
( |
25
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
26
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
27
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
28
|
|
|
|
4
|
|
|
sub { }, |
29
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
30
|
4
|
|
|
4
|
|
20
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
31
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
32
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
33
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
34
|
4
|
|
|
|
|
850
|
); |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Mite imports |
39
|
|
|
|
|
|
|
BEGIN { |
40
|
4
|
|
|
4
|
|
33
|
require Scalar::Util; |
41
|
4
|
|
|
|
|
21
|
*STRICT = \&Acme::Mitey::Cards::Mite::STRICT; |
42
|
4
|
|
|
|
|
12
|
*bare = \&Acme::Mitey::Cards::Mite::bare; |
43
|
4
|
|
|
|
|
9
|
*blessed = \&Scalar::Util::blessed; |
44
|
4
|
|
|
|
|
12
|
*carp = \&Acme::Mitey::Cards::Mite::carp; |
45
|
4
|
|
|
|
|
8
|
*confess = \&Acme::Mitey::Cards::Mite::confess; |
46
|
4
|
|
|
|
|
9
|
*croak = \&Acme::Mitey::Cards::Mite::croak; |
47
|
4
|
|
|
|
|
10
|
*false = \&Acme::Mitey::Cards::Mite::false; |
48
|
4
|
|
|
|
|
10
|
*guard = \&Acme::Mitey::Cards::Mite::guard; |
49
|
4
|
|
|
|
|
8
|
*lazy = \&Acme::Mitey::Cards::Mite::lazy; |
50
|
4
|
|
|
|
|
16
|
*lock = \&Acme::Mitey::Cards::Mite::lock; |
51
|
4
|
|
|
|
|
10
|
*ro = \&Acme::Mitey::Cards::Mite::ro; |
52
|
4
|
|
|
|
|
8
|
*rw = \&Acme::Mitey::Cards::Mite::rw; |
53
|
4
|
|
|
|
|
16
|
*rwp = \&Acme::Mitey::Cards::Mite::rwp; |
54
|
4
|
|
|
|
|
10
|
*true = \&Acme::Mitey::Cards::Mite::true; |
55
|
4
|
|
|
|
|
153
|
*unlock = \&Acme::Mitey::Cards::Mite::unlock; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
BEGIN { |
59
|
4
|
|
|
4
|
|
696
|
require Acme::Mitey::Cards::Set; |
60
|
|
|
|
|
|
|
|
61
|
4
|
|
|
4
|
|
23
|
use mro 'c3'; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
31
|
|
62
|
4
|
|
|
|
|
10
|
our @ISA; |
63
|
4
|
|
|
|
|
758
|
push @ISA, "Acme::Mitey::Cards::Set"; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
67
|
|
|
|
|
|
|
sub new { |
68
|
3
|
50
|
|
3
|
0
|
1131
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
69
|
3
|
|
66
|
|
|
30
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
70
|
3
|
|
|
|
|
10
|
my $self = bless {}, $class; |
71
|
|
|
|
|
|
|
my $args = |
72
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
73
|
|
|
|
|
|
|
? $class->BUILDARGS(@_) |
74
|
3
|
50
|
|
|
|
26
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
75
|
3
|
|
|
|
|
8
|
my $no_build = delete $args->{__no_BUILD__}; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# Attribute cards (type: CardArray) |
78
|
|
|
|
|
|
|
# has declaration, file lib/Acme/Mitey/Cards/Set.pm, line 11 |
79
|
3
|
100
|
|
|
|
17
|
if ( exists $args->{"cards"} ) { |
80
|
|
|
|
|
|
|
( |
81
|
|
|
|
|
|
|
do { |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
84
|
2
|
|
|
|
|
10
|
ref( $args->{"cards"} ) eq 'ARRAY'; |
85
|
|
|
|
|
|
|
} |
86
|
2
|
50
|
33
|
|
|
5
|
and do { |
87
|
2
|
|
|
|
|
5
|
my $ok = 1; |
88
|
2
|
|
|
|
|
3
|
for my $i ( @{ $args->{"cards"} } ) { |
|
2
|
|
|
|
|
7
|
|
89
|
|
|
|
|
|
|
( $ok = 0, last ) |
90
|
|
|
|
|
|
|
unless ( |
91
|
16
|
50
|
|
|
|
24
|
do { |
92
|
4
|
|
|
4
|
|
29
|
use Scalar::Util (); |
|
4
|
|
|
|
|
18
|
|
|
4
|
|
|
|
|
559
|
|
93
|
16
|
50
|
|
|
|
73
|
Scalar::Util::blessed($i) |
94
|
|
|
|
|
|
|
and $i->isa(q[Acme::Mitey::Cards::Card]); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
); |
97
|
|
|
|
|
|
|
}; |
98
|
2
|
|
|
|
|
8
|
$ok; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
) |
101
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
102
|
|
|
|
|
|
|
"cards", "CardArray"; |
103
|
2
|
|
|
|
|
11
|
$self->{"cards"} = $args->{"cards"}; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# Attribute owner (type: Str|Object) |
107
|
|
|
|
|
|
|
# has declaration, file lib/Acme/Mitey/Cards/Hand.pm, line 11 |
108
|
3
|
50
|
|
|
|
10
|
if ( exists $args->{"owner"} ) { |
109
|
3
|
50
|
|
|
|
5
|
do { |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
112
|
|
|
|
|
|
|
( |
113
|
|
|
|
|
|
|
do { |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
116
|
3
|
50
|
|
|
|
13
|
defined( $args->{"owner"} ) and do { |
117
|
|
|
|
|
|
|
ref( \$args->{"owner"} ) eq 'SCALAR' |
118
|
3
|
50
|
|
|
|
20
|
or ref( \( my $val = $args->{"owner"} ) ) eq |
119
|
|
|
|
|
|
|
'SCALAR'; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
or ( |
123
|
3
|
50
|
|
|
|
5
|
do { |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
126
|
4
|
|
|
4
|
|
31
|
use Scalar::Util (); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
1366
|
|
127
|
0
|
|
|
|
|
0
|
Scalar::Util::blessed( $args->{"owner"} ); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
) |
130
|
|
|
|
|
|
|
); |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
133
|
|
|
|
|
|
|
"owner", "Str|Object"; |
134
|
3
|
|
|
|
|
10
|
$self->{"owner"} = $args->{"owner"}; |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
# Call BUILD methods |
138
|
3
|
50
|
33
|
|
|
19
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
3
|
50
|
|
|
|
26
|
|
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
# Unrecognized parameters |
141
|
3
|
|
|
|
|
7
|
my @unknown = grep not(/\A(?:cards|owner)\z/), keys %{$args}; |
|
3
|
|
|
|
|
27
|
|
142
|
|
|
|
|
|
|
@unknown |
143
|
3
|
50
|
|
|
|
10
|
and croak( |
144
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
145
|
|
|
|
|
|
|
|
146
|
3
|
|
|
|
|
24
|
return $self; |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
150
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# Accessors for owner |
153
|
|
|
|
|
|
|
# has declaration, file lib/Acme/Mitey/Cards/Hand.pm, line 11 |
154
|
|
|
|
|
|
|
sub owner { |
155
|
|
|
|
|
|
|
@_ > 1 |
156
|
|
|
|
|
|
|
? do { |
157
|
0
|
0
|
|
|
|
|
do { |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
160
|
|
|
|
|
|
|
( |
161
|
|
|
|
|
|
|
do { |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
164
|
0
|
0
|
|
|
|
|
defined( $_[1] ) and do { |
165
|
0
|
0
|
|
|
|
|
ref( \$_[1] ) eq 'SCALAR' |
166
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
or ( |
170
|
0
|
0
|
|
|
|
|
do { |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
173
|
4
|
|
|
4
|
|
32
|
use Scalar::Util (); |
|
4
|
|
|
|
|
20
|
|
|
4
|
|
|
|
|
1062
|
|
174
|
0
|
|
|
|
|
|
Scalar::Util::blessed( $_[1] ); |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
) |
177
|
|
|
|
|
|
|
); |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
180
|
|
|
|
|
|
|
"accessor", "Str|Object" ); |
181
|
0
|
|
|
|
|
|
$_[0]{"owner"} = $_[1]; |
182
|
0
|
|
|
|
|
|
$_[0]; |
183
|
|
|
|
|
|
|
} |
184
|
3
|
50
|
|
3
|
0
|
1888
|
: ( $_[0]{"owner"} ); |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
# See UNIVERSAL |
188
|
|
|
|
|
|
|
sub DOES { |
189
|
0
|
|
|
0
|
0
|
|
my ( $self, $role ) = @_; |
190
|
0
|
|
|
|
|
|
our %DOES; |
191
|
0
|
0
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
192
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
193
|
0
|
0
|
0
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
|
|
|
0
|
|
|
|
|
194
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
195
|
|
|
|
|
|
|
{ |
196
|
0
|
0
|
0
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
197
|
|
|
|
|
|
|
} |
198
|
0
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
202
|
|
|
|
|
|
|
sub does { |
203
|
0
|
|
|
0
|
0
|
|
shift->DOES(@_); |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
1; |
207
|
|
|
|
|
|
|
} |