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