| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
{ |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Deck; |
|
4
|
3
|
|
|
3
|
|
22
|
use strict; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
94
|
|
|
5
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
84
|
|
|
6
|
3
|
|
|
3
|
|
15
|
no warnings qw( once void ); |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
410
|
|
|
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
|
3
|
|
|
3
|
|
16
|
my ( $SHIM, $CALLER ) = |
|
15
|
|
|
|
|
|
|
( "Acme::Mitey::Cards::Mite", "Acme::Mitey::Cards::Deck" ); |
|
16
|
|
|
|
|
|
|
( |
|
17
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
|
18
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
|
19
|
|
|
|
|
|
|
) |
|
20
|
3
|
|
|
|
|
7
|
= do { |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
|
23
|
3
|
|
|
3
|
|
22
|
no warnings 'redefine'; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
722
|
|
|
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
|
6
|
|
|
6
|
|
26
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
|
31
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
|
32
|
6
|
|
|
6
|
|
22
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
|
33
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
|
34
|
3
|
|
|
|
|
557
|
); |
|
35
|
|
|
|
|
|
|
}; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Mite imports |
|
39
|
|
|
|
|
|
|
BEGIN { |
|
40
|
3
|
|
|
3
|
|
21
|
require Scalar::Util; |
|
41
|
3
|
|
|
|
|
10
|
*STRICT = \&Acme::Mitey::Cards::Mite::STRICT; |
|
42
|
3
|
|
|
|
|
6
|
*bare = \&Acme::Mitey::Cards::Mite::bare; |
|
43
|
3
|
|
|
|
|
14
|
*blessed = \&Scalar::Util::blessed; |
|
44
|
3
|
|
|
|
|
6
|
*carp = \&Acme::Mitey::Cards::Mite::carp; |
|
45
|
3
|
|
|
|
|
7
|
*confess = \&Acme::Mitey::Cards::Mite::confess; |
|
46
|
3
|
|
|
|
|
12
|
*croak = \&Acme::Mitey::Cards::Mite::croak; |
|
47
|
3
|
|
|
|
|
10
|
*false = \&Acme::Mitey::Cards::Mite::false; |
|
48
|
3
|
|
|
|
|
5
|
*guard = \&Acme::Mitey::Cards::Mite::guard; |
|
49
|
3
|
|
|
|
|
5
|
*lazy = \&Acme::Mitey::Cards::Mite::lazy; |
|
50
|
3
|
|
|
|
|
6
|
*lock = \&Acme::Mitey::Cards::Mite::lock; |
|
51
|
3
|
|
|
|
|
6
|
*ro = \&Acme::Mitey::Cards::Mite::ro; |
|
52
|
3
|
|
|
|
|
5
|
*rw = \&Acme::Mitey::Cards::Mite::rw; |
|
53
|
3
|
|
|
|
|
6
|
*rwp = \&Acme::Mitey::Cards::Mite::rwp; |
|
54
|
3
|
|
|
|
|
19
|
*true = \&Acme::Mitey::Cards::Mite::true; |
|
55
|
3
|
|
|
|
|
123
|
*unlock = \&Acme::Mitey::Cards::Mite::unlock; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
BEGIN { |
|
59
|
3
|
|
|
3
|
|
622
|
require Acme::Mitey::Cards::Set; |
|
60
|
|
|
|
|
|
|
|
|
61
|
3
|
|
|
3
|
|
18
|
use mro 'c3'; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
27
|
|
|
62
|
3
|
|
|
|
|
7
|
our @ISA; |
|
63
|
3
|
|
|
|
|
593
|
push @ISA, "Acme::Mitey::Cards::Set"; |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
|
67
|
|
|
|
|
|
|
sub new { |
|
68
|
1
|
50
|
|
1
|
0
|
614
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
|
69
|
1
|
|
33
|
|
|
14
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
|
70
|
1
|
|
|
|
|
5
|
my $self = bless {}, $class; |
|
71
|
|
|
|
|
|
|
my $args = |
|
72
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
|
73
|
|
|
|
|
|
|
? $class->BUILDARGS(@_) |
|
74
|
1
|
50
|
|
|
|
11
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
|
0
|
50
|
|
|
|
0
|
|
|
75
|
1
|
|
|
|
|
4
|
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
|
1
|
50
|
|
|
|
5
|
if ( exists $args->{"cards"} ) { |
|
80
|
|
|
|
|
|
|
( |
|
81
|
|
|
|
|
|
|
do { |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
|
84
|
0
|
|
|
|
|
0
|
ref( $args->{"cards"} ) eq 'ARRAY'; |
|
85
|
|
|
|
|
|
|
} |
|
86
|
0
|
0
|
0
|
|
|
0
|
and do { |
|
87
|
0
|
|
|
|
|
0
|
my $ok = 1; |
|
88
|
0
|
|
|
|
|
0
|
for my $i ( @{ $args->{"cards"} } ) { |
|
|
0
|
|
|
|
|
0
|
|
|
89
|
|
|
|
|
|
|
( $ok = 0, last ) |
|
90
|
|
|
|
|
|
|
unless ( |
|
91
|
0
|
0
|
|
|
|
0
|
do { |
|
92
|
3
|
|
|
3
|
|
23
|
use Scalar::Util (); |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
660
|
|
|
93
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($i) |
|
94
|
|
|
|
|
|
|
and $i->isa(q[Acme::Mitey::Cards::Card]); |
|
95
|
|
|
|
|
|
|
} |
|
96
|
|
|
|
|
|
|
); |
|
97
|
|
|
|
|
|
|
}; |
|
98
|
0
|
|
|
|
|
0
|
$ok; |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
) |
|
101
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
102
|
|
|
|
|
|
|
"cards", "CardArray"; |
|
103
|
0
|
|
|
|
|
0
|
$self->{"cards"} = $args->{"cards"}; |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# Attribute reverse (type: NonEmptyStr) |
|
107
|
|
|
|
|
|
|
# has declaration, file lib/Acme/Mitey/Cards/Deck.pm, line 17 |
|
108
|
1
|
|
|
|
|
3
|
do { |
|
109
|
|
|
|
|
|
|
my $value = |
|
110
|
1
|
50
|
|
|
|
5
|
exists( $args->{"reverse"} ) ? $args->{"reverse"} : "plain"; |
|
111
|
|
|
|
|
|
|
( |
|
112
|
|
|
|
|
|
|
( |
|
113
|
1
|
50
|
33
|
|
|
3
|
do { |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
|
116
|
1
|
50
|
|
|
|
5
|
defined($value) and do { |
|
117
|
1
|
50
|
|
|
|
30
|
ref( \$value ) eq 'SCALAR' |
|
118
|
|
|
|
|
|
|
or ref( \( my $val = $value ) ) eq 'SCALAR'; |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
} |
|
121
|
|
|
|
|
|
|
) |
|
122
|
|
|
|
|
|
|
&& ( length($value) > 0 ) |
|
123
|
|
|
|
|
|
|
) |
|
124
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
125
|
|
|
|
|
|
|
"reverse", "NonEmptyStr"; |
|
126
|
1
|
|
|
|
|
9
|
$self->{"reverse"} = $value; |
|
127
|
|
|
|
|
|
|
}; |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
# Attribute original_cards (type: CardArray) |
|
130
|
|
|
|
|
|
|
# has declaration, file lib/Acme/Mitey/Cards/Deck.pm, line 23 |
|
131
|
1
|
50
|
|
|
|
5
|
if ( exists $args->{"original_cards"} ) { |
|
132
|
|
|
|
|
|
|
( |
|
133
|
|
|
|
|
|
|
do { |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
|
136
|
0
|
|
|
|
|
0
|
ref( $args->{"original_cards"} ) eq 'ARRAY'; |
|
137
|
|
|
|
|
|
|
} |
|
138
|
0
|
0
|
0
|
|
|
0
|
and do { |
|
139
|
0
|
|
|
|
|
0
|
my $ok = 1; |
|
140
|
0
|
|
|
|
|
0
|
for my $i ( @{ $args->{"original_cards"} } ) { |
|
|
0
|
|
|
|
|
0
|
|
|
141
|
|
|
|
|
|
|
( $ok = 0, last ) |
|
142
|
|
|
|
|
|
|
unless ( |
|
143
|
0
|
0
|
|
|
|
0
|
do { |
|
144
|
3
|
|
|
3
|
|
24
|
use Scalar::Util (); |
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
1097
|
|
|
145
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($i) |
|
146
|
|
|
|
|
|
|
and $i->isa(q[Acme::Mitey::Cards::Card]); |
|
147
|
|
|
|
|
|
|
} |
|
148
|
|
|
|
|
|
|
); |
|
149
|
|
|
|
|
|
|
}; |
|
150
|
0
|
|
|
|
|
0
|
$ok; |
|
151
|
|
|
|
|
|
|
} |
|
152
|
|
|
|
|
|
|
) |
|
153
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
154
|
|
|
|
|
|
|
"original_cards", "CardArray"; |
|
155
|
0
|
|
|
|
|
0
|
$self->{"original_cards"} = $args->{"original_cards"}; |
|
156
|
|
|
|
|
|
|
} |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# Call BUILD methods |
|
159
|
1
|
50
|
33
|
|
|
5
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
|
1
|
50
|
|
|
|
7
|
|
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
# Unrecognized parameters |
|
162
|
|
|
|
|
|
|
my @unknown = grep not(/\A(?:cards|original_cards|reverse)\z/), |
|
163
|
1
|
|
|
|
|
3
|
keys %{$args}; |
|
|
1
|
|
|
|
|
4
|
|
|
164
|
|
|
|
|
|
|
@unknown |
|
165
|
1
|
50
|
|
|
|
4
|
and croak( |
|
166
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
167
|
|
|
|
|
|
|
|
|
168
|
1
|
|
|
|
|
5
|
return $self; |
|
169
|
|
|
|
|
|
|
} |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
|
172
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Accessors for original_cards |
|
175
|
|
|
|
|
|
|
# has declaration, file lib/Acme/Mitey/Cards/Deck.pm, line 23 |
|
176
|
|
|
|
|
|
|
sub original_cards { |
|
177
|
1
|
50
|
|
1
|
0
|
11
|
@_ == 1 |
|
178
|
|
|
|
|
|
|
or croak('Reader "original_cards" usage: $self->original_cards()'); |
|
179
|
|
|
|
|
|
|
( |
|
180
|
|
|
|
|
|
|
exists( $_[0]{"original_cards"} ) ? $_[0]{"original_cards"} : ( |
|
181
|
1
|
50
|
|
|
|
6
|
$_[0]{"original_cards"} = do { |
|
182
|
1
|
|
|
|
|
5
|
my $default_value = $_[0]->_build_original_cards; |
|
183
|
1
|
50
|
|
|
|
3
|
do { |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Mite; |
|
186
|
1
|
50
|
|
|
|
6
|
( ref($default_value) eq 'ARRAY' ) and do { |
|
187
|
1
|
|
|
|
|
2
|
my $ok = 1; |
|
188
|
1
|
|
|
|
|
3
|
for my $i ( @{$default_value} ) { |
|
|
1
|
|
|
|
|
2
|
|
|
189
|
|
|
|
|
|
|
( $ok = 0, last ) |
|
190
|
|
|
|
|
|
|
unless ( |
|
191
|
54
|
50
|
|
|
|
77
|
do { |
|
192
|
3
|
|
|
3
|
|
24
|
use Scalar::Util (); |
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
2092
|
|
|
193
|
54
|
50
|
|
|
|
221
|
Scalar::Util::blessed($i) |
|
194
|
|
|
|
|
|
|
and |
|
195
|
|
|
|
|
|
|
$i->isa(q[Acme::Mitey::Cards::Card]); |
|
196
|
|
|
|
|
|
|
} |
|
197
|
|
|
|
|
|
|
); |
|
198
|
|
|
|
|
|
|
}; |
|
199
|
1
|
|
|
|
|
6
|
$ok; |
|
200
|
|
|
|
|
|
|
} |
|
201
|
|
|
|
|
|
|
} |
|
202
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
|
203
|
|
|
|
|
|
|
"original_cards", "CardArray" ); |
|
204
|
1
|
|
|
|
|
10
|
$default_value; |
|
205
|
|
|
|
|
|
|
} |
|
206
|
|
|
|
|
|
|
) |
|
207
|
|
|
|
|
|
|
); |
|
208
|
|
|
|
|
|
|
} |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
# Accessors for reverse |
|
211
|
|
|
|
|
|
|
# has declaration, file lib/Acme/Mitey/Cards/Deck.pm, line 17 |
|
212
|
|
|
|
|
|
|
if ($__XS) { |
|
213
|
|
|
|
|
|
|
Class::XSAccessor->import( |
|
214
|
|
|
|
|
|
|
chained => 1, |
|
215
|
|
|
|
|
|
|
"getters" => { "reverse" => "reverse" }, |
|
216
|
|
|
|
|
|
|
); |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
else { |
|
219
|
|
|
|
|
|
|
*reverse = sub { |
|
220
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "reverse" usage: $self->reverse()'); |
|
221
|
|
|
|
|
|
|
$_[0]{"reverse"}; |
|
222
|
|
|
|
|
|
|
}; |
|
223
|
|
|
|
|
|
|
} |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
# See UNIVERSAL |
|
226
|
|
|
|
|
|
|
sub DOES { |
|
227
|
0
|
|
|
0
|
0
|
0
|
my ( $self, $role ) = @_; |
|
228
|
0
|
|
|
|
|
0
|
our %DOES; |
|
229
|
0
|
0
|
|
|
|
0
|
return $DOES{$role} if exists $DOES{$role}; |
|
230
|
0
|
0
|
|
|
|
0
|
return 1 if $role eq __PACKAGE__; |
|
231
|
0
|
0
|
0
|
|
|
0
|
if ( $INC{'Moose/Util.pm'} |
|
|
|
|
0
|
|
|
|
|
|
232
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
|
233
|
|
|
|
|
|
|
{ |
|
234
|
0
|
0
|
0
|
|
|
0
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
|
235
|
|
|
|
|
|
|
} |
|
236
|
0
|
|
|
|
|
0
|
return $self->SUPER::DOES($role); |
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
|
240
|
|
|
|
|
|
|
sub does { |
|
241
|
0
|
|
|
0
|
0
|
0
|
shift->DOES(@_); |
|
242
|
|
|
|
|
|
|
} |
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
# Method signatures |
|
245
|
|
|
|
|
|
|
our %SIGNATURE_FOR; |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
$SIGNATURE_FOR{"deal_hand"} = sub { |
|
248
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
my ( %out, %in, %tmp, $tmp, $dtmp, @head ); |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
@_ == 2 && ( ref( $_[1] ) eq 'HASH' ) |
|
253
|
|
|
|
|
|
|
or @_ % 2 == 1 && @_ >= 1 |
|
254
|
|
|
|
|
|
|
or |
|
255
|
|
|
|
|
|
|
croak( "Wrong number of parameters in signature for %s: got %d, %s", |
|
256
|
|
|
|
|
|
|
"deal_hand", scalar(@_), "that does not seem right" ); |
|
257
|
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
|
259
|
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
|
261
|
|
|
|
|
|
|
( defined( $head[0] ) ) |
|
262
|
|
|
|
|
|
|
or croak( |
|
263
|
|
|
|
|
|
|
"Type check failed in signature for deal_hand: %s should be %s", |
|
264
|
|
|
|
|
|
|
"\$_[0]", "Defined" ); |
|
265
|
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
%in = ( @_ == 1 and ( ref( $_[0] ) eq 'HASH' ) ) ? %{ $_[0] } : @_; |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
# Parameter count (type: Int) |
|
269
|
|
|
|
|
|
|
$dtmp = exists( $in{"count"} ) ? $in{"count"} : "7"; |
|
270
|
|
|
|
|
|
|
( |
|
271
|
|
|
|
|
|
|
do { |
|
272
|
|
|
|
|
|
|
my $tmp = $dtmp; |
|
273
|
|
|
|
|
|
|
defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/; |
|
274
|
|
|
|
|
|
|
} |
|
275
|
|
|
|
|
|
|
) |
|
276
|
|
|
|
|
|
|
or croak( |
|
277
|
|
|
|
|
|
|
"Type check failed in signature for deal_hand: %s should be %s", |
|
278
|
|
|
|
|
|
|
"\$_{\"count\"}", "Int" ); |
|
279
|
|
|
|
|
|
|
$out{"count"} = $dtmp; |
|
280
|
|
|
|
|
|
|
delete( $in{"count"} ); |
|
281
|
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
my $SLURPY = \%in; |
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
# Parameter args_for_hand (type: Slurpy[HashRef]) |
|
285
|
|
|
|
|
|
|
( ( ref($SLURPY) eq 'HASH' ) ) |
|
286
|
|
|
|
|
|
|
or croak( |
|
287
|
|
|
|
|
|
|
"Type check failed in signature for deal_hand: %s should be %s", |
|
288
|
|
|
|
|
|
|
"\$SLURPY", "HashRef" ); |
|
289
|
|
|
|
|
|
|
$out{"args_for_hand"} = $SLURPY; |
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
do { |
|
292
|
|
|
|
|
|
|
@_ = ( |
|
293
|
|
|
|
|
|
|
@head, |
|
294
|
|
|
|
|
|
|
bless( |
|
295
|
|
|
|
|
|
|
\%out, |
|
296
|
|
|
|
|
|
|
"Acme::Mitey::Cards::Deck::__NAMED_ARGUMENTS__::deal_hand" |
|
297
|
|
|
|
|
|
|
) |
|
298
|
|
|
|
|
|
|
); |
|
299
|
|
|
|
|
|
|
goto $__NEXT__; |
|
300
|
|
|
|
|
|
|
}; |
|
301
|
|
|
|
|
|
|
}; |
|
302
|
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
{ |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Deck::__NAMED_ARGUMENTS__::deal_hand; |
|
306
|
3
|
|
|
3
|
|
25
|
use strict; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
94
|
|
|
307
|
3
|
|
|
3
|
|
16
|
no warnings; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
805
|
|
|
308
|
2
|
|
|
2
|
|
8
|
sub args_for_hand { $_[0]{"args_for_hand"} } |
|
309
|
4
|
|
|
4
|
|
109
|
sub count { $_[0]{"count"} } |
|
310
|
0
|
|
|
0
|
|
|
sub has_count { exists $_[0]{"count"} } |
|
311
|
|
|
|
|
|
|
1; |
|
312
|
|
|
|
|
|
|
} |
|
313
|
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
$SIGNATURE_FOR{"discard_jokers"} = sub { |
|
315
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
|
316
|
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
my ( %tmp, $tmp, @head ); |
|
318
|
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
@_ == 1 |
|
320
|
|
|
|
|
|
|
or |
|
321
|
|
|
|
|
|
|
croak( "Wrong number of parameters in signature for %s: got %d, %s", |
|
322
|
|
|
|
|
|
|
"discard_jokers", scalar(@_), "expected exactly 1 parameters" ); |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
|
327
|
|
|
|
|
|
|
( defined( $head[0] ) ) |
|
328
|
|
|
|
|
|
|
or croak( |
|
329
|
|
|
|
|
|
|
"Type check failed in signature for discard_jokers: %s should be %s", |
|
330
|
|
|
|
|
|
|
"\$_[0]", "Defined" |
|
331
|
|
|
|
|
|
|
); |
|
332
|
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
do { @_ = ( @head, @_ ); goto $__NEXT__ }; |
|
334
|
|
|
|
|
|
|
}; |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
1; |
|
337
|
|
|
|
|
|
|
} |