line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Game::TileMap::Role::Checks; |
2
|
|
|
|
|
|
|
$Game::TileMap::Role::Checks::VERSION = '1.000'; |
3
|
3
|
|
|
3
|
|
29493
|
use v5.10; |
|
3
|
|
|
|
|
12
|
|
4
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
64
|
|
5
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
73
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
15
|
use Moo::Role; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
18
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
requires qw( |
10
|
|
|
|
|
|
|
coordinates |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub check_within_map |
14
|
|
|
|
|
|
|
{ |
15
|
13
|
|
|
13
|
0
|
9980
|
my ($self, $x, $y) = @_; |
16
|
|
|
|
|
|
|
|
17
|
13
|
100
|
100
|
|
|
83
|
return !!0 if $x < 0 || $y < 0; |
18
|
|
|
|
|
|
|
|
19
|
11
|
|
|
|
|
38
|
my $obj = $self->coordinates->[$x][$y]; |
20
|
11
|
|
100
|
|
|
76
|
return $obj && !$obj->is_wall; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub check_can_be_accessed |
24
|
|
|
|
|
|
|
{ |
25
|
13
|
|
|
13
|
0
|
4787
|
my ($self, $x, $y) = @_; |
26
|
|
|
|
|
|
|
|
27
|
13
|
100
|
100
|
|
|
73
|
return !!0 if $x < 0 || $y < 0; |
28
|
|
|
|
|
|
|
|
29
|
11
|
|
|
|
|
38
|
my $obj = $self->coordinates->[$x][$y]; |
30
|
11
|
|
100
|
|
|
117
|
return $obj && !$obj->is_wall && !$obj->is_void; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|