line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Hand; |
4
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
72
|
|
5
|
3
|
|
|
3
|
|
30
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
476
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
8
|
|
|
|
|
|
|
our $MITE_SHIM = "Acme::Mitey::Cards::Mite"; |
9
|
|
|
|
|
|
|
our $MITE_VERSION = "0.007003"; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
3
|
|
|
3
|
|
19
|
require Scalar::Util; |
13
|
3
|
|
|
|
|
11
|
*bare = \&Acme::Mitey::Cards::Mite::bare; |
14
|
3
|
|
|
|
|
5
|
*blessed = \&Scalar::Util::blessed; |
15
|
3
|
|
|
|
|
6
|
*carp = \&Acme::Mitey::Cards::Mite::carp; |
16
|
3
|
|
|
|
|
5
|
*confess = \&Acme::Mitey::Cards::Mite::confess; |
17
|
3
|
|
|
|
|
18
|
*croak = \&Acme::Mitey::Cards::Mite::croak; |
18
|
3
|
|
|
|
|
6
|
*false = \&Acme::Mitey::Cards::Mite::false; |
19
|
3
|
|
|
|
|
6
|
*guard = \&Acme::Mitey::Cards::Mite::guard; |
20
|
3
|
|
|
|
|
5
|
*lazy = \&Acme::Mitey::Cards::Mite::lazy; |
21
|
3
|
|
|
|
|
3
|
*ro = \&Acme::Mitey::Cards::Mite::ro; |
22
|
3
|
|
|
|
|
6
|
*rw = \&Acme::Mitey::Cards::Mite::rw; |
23
|
3
|
|
|
|
|
4
|
*rwp = \&Acme::Mitey::Cards::Mite::rwp; |
24
|
3
|
|
|
|
|
96
|
*true = \&Acme::Mitey::Cards::Mite::true; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
BEGIN { |
28
|
3
|
|
|
3
|
|
483
|
require Acme::Mitey::Cards::Set; |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
3
|
|
15
|
use mro 'c3'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
30
|
|
31
|
3
|
|
|
|
|
6
|
our @ISA; |
32
|
3
|
|
|
|
|
435
|
push @ISA, "Acme::Mitey::Cards::Set"; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub new { |
36
|
3
|
50
|
|
3
|
0
|
949
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
37
|
3
|
|
66
|
|
|
20
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
38
|
3
|
|
|
|
|
8
|
my $self = bless {}, $class; |
39
|
|
|
|
|
|
|
my $args = |
40
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
41
|
|
|
|
|
|
|
? $class->BUILDARGS(@_) |
42
|
3
|
50
|
|
|
|
33
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
43
|
3
|
|
|
|
|
8
|
my $no_build = delete $args->{__no_BUILD__}; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Attribute: cards |
46
|
3
|
100
|
|
|
|
7
|
if ( exists $args->{"cards"} ) { |
47
|
|
|
|
|
|
|
( |
48
|
|
|
|
|
|
|
do { |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
51
|
2
|
|
|
|
|
9
|
ref( $args->{"cards"} ) eq 'ARRAY'; |
52
|
|
|
|
|
|
|
} |
53
|
2
|
50
|
33
|
|
|
2
|
and do { |
54
|
2
|
|
|
|
|
3
|
my $ok = 1; |
55
|
2
|
|
|
|
|
2
|
for my $i ( @{ $args->{"cards"} } ) { |
|
2
|
|
|
|
|
5
|
|
56
|
|
|
|
|
|
|
( $ok = 0, last ) |
57
|
|
|
|
|
|
|
unless ( |
58
|
16
|
50
|
|
|
|
19
|
do { |
59
|
3
|
|
|
3
|
|
19
|
use Scalar::Util (); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
295
|
|
60
|
16
|
50
|
|
|
|
62
|
Scalar::Util::blessed($i) |
61
|
|
|
|
|
|
|
and $i->isa(q[Acme::Mitey::Cards::Card]); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
}; |
65
|
2
|
|
|
|
|
5
|
$ok; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
) |
68
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
69
|
|
|
|
|
|
|
"cards", "CardArray"; |
70
|
2
|
|
|
|
|
14
|
$self->{"cards"} = $args->{"cards"}; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Attribute: owner |
74
|
3
|
50
|
|
|
|
9
|
if ( exists $args->{"owner"} ) { |
75
|
3
|
50
|
|
|
|
4
|
do { |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
78
|
|
|
|
|
|
|
( |
79
|
|
|
|
|
|
|
do { |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
82
|
3
|
50
|
|
|
|
7
|
defined( $args->{"owner"} ) and do { |
83
|
|
|
|
|
|
|
ref( \$args->{"owner"} ) eq 'SCALAR' |
84
|
3
|
50
|
|
|
|
18
|
or ref( \( my $val = $args->{"owner"} ) ) eq |
85
|
|
|
|
|
|
|
'SCALAR'; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
or ( |
89
|
3
|
50
|
|
|
|
5
|
do { |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
92
|
3
|
|
|
3
|
|
17
|
use Scalar::Util (); |
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
1036
|
|
93
|
0
|
|
|
|
|
0
|
Scalar::Util::blessed( $args->{"owner"} ); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
) |
96
|
|
|
|
|
|
|
); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
99
|
|
|
|
|
|
|
"owner", "Str|Object"; |
100
|
3
|
|
|
|
|
10
|
$self->{"owner"} = $args->{"owner"}; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
# Enforce strict constructor |
104
|
3
|
|
|
|
|
6
|
my @unknown = grep not(/\A(?:cards|owner)\z/), keys %{$args}; |
|
3
|
|
|
|
|
19
|
|
105
|
|
|
|
|
|
|
@unknown |
106
|
3
|
50
|
|
|
|
15
|
and croak( |
107
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# Call BUILD methods |
110
|
3
|
50
|
33
|
|
|
9
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
3
|
50
|
|
|
|
12
|
|
111
|
|
|
|
|
|
|
|
112
|
3
|
|
|
|
|
14
|
return $self; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub DOES { |
116
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $role ) = @_; |
117
|
0
|
|
|
|
|
0
|
our %DOES; |
118
|
0
|
0
|
|
|
|
0
|
return $DOES{$role} if exists $DOES{$role}; |
119
|
0
|
0
|
|
|
|
0
|
return 1 if $role eq __PACKAGE__; |
120
|
0
|
|
|
|
|
0
|
return $self->SUPER::DOES($role); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub does { |
124
|
0
|
|
|
0
|
0
|
0
|
shift->DOES(@_); |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
my $__XS = !$ENV{MITE_PURE_PERL} |
128
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
# Accessors for owner |
131
|
|
|
|
|
|
|
sub owner { |
132
|
|
|
|
|
|
|
@_ > 1 |
133
|
|
|
|
|
|
|
? do { |
134
|
0
|
0
|
|
|
|
|
do { |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
137
|
|
|
|
|
|
|
( |
138
|
|
|
|
|
|
|
do { |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
141
|
0
|
0
|
|
|
|
|
defined( $_[1] ) and do { |
142
|
0
|
0
|
|
|
|
|
ref( \$_[1] ) eq 'SCALAR' |
143
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
or ( |
147
|
0
|
0
|
|
|
|
|
do { |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
150
|
3
|
|
|
3
|
|
20
|
use Scalar::Util (); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
320
|
|
151
|
0
|
|
|
|
|
|
Scalar::Util::blessed( $_[1] ); |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
) |
154
|
|
|
|
|
|
|
); |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
157
|
|
|
|
|
|
|
"accessor", "Str|Object" ); |
158
|
0
|
|
|
|
|
|
$_[0]{"owner"} = $_[1]; |
159
|
0
|
|
|
|
|
|
$_[0]; |
160
|
|
|
|
|
|
|
} |
161
|
3
|
50
|
|
3
|
0
|
1549
|
: ( $_[0]{"owner"} ); |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
1; |
165
|
|
|
|
|
|
|
} |