line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Game::TileMap::Tile; |
2
|
|
|
|
|
|
|
$Game::TileMap::Tile::VERSION = '1.000'; |
3
|
3
|
|
|
3
|
|
41
|
use v5.10; |
|
3
|
|
|
|
|
10
|
|
4
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
27
|
|
|
3
|
|
|
|
|
80
|
|
5
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
86
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
16
|
use Moo; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
17
|
|
8
|
3
|
|
|
3
|
|
1000
|
use Mooish::AttributeBuilder -standard; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
18
|
|
9
|
3
|
|
|
3
|
|
402
|
use Carp qw(croak); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
747
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has param ['x', 'y'] => ( |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# isa => PositiveInt, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has param 'contents' => ( |
17
|
|
|
|
|
|
|
writer => 1, |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# isa => Any, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has field 'is_wall' => ( |
23
|
|
|
|
|
|
|
writer => -hidden, |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# isa => Bool, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has field 'is_void' => ( |
29
|
|
|
|
|
|
|
writer => -hidden, |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# isa => Bool, |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has field 'type' => ( |
35
|
|
|
|
|
|
|
writer => -hidden, |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# isa => Any, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub BUILD |
41
|
|
|
|
|
|
|
{ |
42
|
186
|
|
|
186
|
0
|
7639
|
my ($self, $args) = @_; |
43
|
|
|
|
|
|
|
|
44
|
186
|
|
|
|
|
265
|
my $legend = $args->{legend}; |
45
|
186
|
50
|
|
|
|
361
|
croak "argument legend is required for Game::TileMap::Tile" |
46
|
|
|
|
|
|
|
unless $legend; |
47
|
|
|
|
|
|
|
|
48
|
186
|
|
|
|
|
467
|
$self->_set_type($self->contents); |
49
|
186
|
|
|
|
|
650
|
$self->_set_is_void($legend->voids->{$self->type}); |
50
|
186
|
|
|
|
|
1031
|
$self->_set_is_wall($legend->walls->{$self->type}); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |