line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Game::TileMap::Role::Checks; |
2
|
|
|
|
|
|
|
$Game::TileMap::Role::Checks::VERSION = '0.002'; |
3
|
2
|
|
|
2
|
|
19369
|
use v5.10; |
|
2
|
|
|
|
|
7
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
41
|
|
5
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
44
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
10
|
use Moo::Role; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
8
|
2
|
|
|
2
|
|
732
|
use Mooish::AttributeBuilder -standard; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
279
|
use Game::TileMap::Legend; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
438
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
requires qw( |
13
|
|
|
|
|
|
|
coordinates |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub check_within_map |
17
|
|
|
|
|
|
|
{ |
18
|
9
|
|
|
9
|
0
|
8690
|
my ($self, $x, $y) = @_; |
19
|
|
|
|
|
|
|
|
20
|
9
|
100
|
100
|
|
|
50
|
return !!0 if $x < 0 || $y < 0; |
21
|
|
|
|
|
|
|
|
22
|
7
|
|
|
|
|
22
|
my $obj = $self->coordinates->[$x][$y]; |
23
|
7
|
|
100
|
|
|
65
|
return $obj && $obj->type ne Game::TileMap::Legend::WALL_OBJECT; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub check_can_be_accessed |
27
|
|
|
|
|
|
|
{ |
28
|
9
|
|
|
9
|
0
|
2199
|
my ($self, $x, $y) = @_; |
29
|
|
|
|
|
|
|
|
30
|
9
|
100
|
100
|
|
|
46
|
return !!0 if $x < 0 || $y < 0; |
31
|
|
|
|
|
|
|
|
32
|
7
|
|
|
|
|
23
|
my $obj = $self->coordinates->[$x][$y]; |
33
|
7
|
|
100
|
|
|
43
|
return $obj && $obj->type; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|