line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Game::TextPacMonster::Point; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
748
|
use strict; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
226
|
|
4
|
11
|
|
|
11
|
|
51
|
use warnings; |
|
11
|
|
|
|
|
15
|
|
|
11
|
|
|
|
|
209
|
|
5
|
11
|
|
|
11
|
|
48
|
use utf8; |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
48
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
476
|
|
|
476
|
0
|
2805
|
my ( $class, $x, $y ) = @_; |
10
|
476
|
|
|
|
|
1220
|
my $self = { |
11
|
|
|
|
|
|
|
x => $x, |
12
|
|
|
|
|
|
|
y => $y, |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
|
15
|
476
|
|
|
|
|
1785
|
bless $self, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub equals { |
20
|
49
|
|
|
49
|
0
|
99
|
my ( $self, $point ) = @_; |
21
|
49
|
100
|
|
|
|
95
|
my $result_x = ( $self->x_coord == $point->x_coord ) ? 1 : 0; |
22
|
49
|
100
|
|
|
|
100
|
my $result_y = ( $self->y_coord == $point->y_coord ) ? 1 : 0; |
23
|
|
|
|
|
|
|
|
24
|
49
|
100
|
100
|
|
|
189
|
if ( $result_x && $result_y ) { |
25
|
12
|
|
|
|
|
79
|
return 1; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
37
|
|
|
|
|
164
|
return 0; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub x_coord { |
34
|
769
|
|
|
769
|
0
|
876
|
my $self = shift; |
35
|
769
|
100
|
|
|
|
1242
|
if (@_) { |
36
|
1
|
|
|
|
|
3
|
$self->{x} = shift; |
37
|
1
|
|
|
|
|
6
|
return $self; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
else { |
40
|
768
|
|
|
|
|
2445
|
return $self->{x}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub y_coord { |
46
|
779
|
|
|
779
|
0
|
853
|
my $self = shift; |
47
|
779
|
100
|
|
|
|
1188
|
if (@_) { |
48
|
1
|
|
|
|
|
2
|
$self->{y} = shift; |
49
|
1
|
|
|
|
|
4
|
return $self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else { |
52
|
778
|
|
|
|
|
2369
|
return $self->{y}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |