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