line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Game::TileMap::Role::Helpers; |
2
|
|
|
|
|
|
|
$Game::TileMap::Role::Helpers::VERSION = '0.001'; |
3
|
2
|
|
|
2
|
|
1026
|
use v5.10; |
|
2
|
|
|
|
|
8
|
|
4
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
5
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
47
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
9
|
use Moo::Role; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
8
|
2
|
|
|
2
|
|
744
|
use Mooish::AttributeBuilder -standard; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
11
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
283
|
use Game::TileMap::Legend; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
391
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
requires qw( |
13
|
|
|
|
|
|
|
legend |
14
|
|
|
|
|
|
|
_guide |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get_all_of_class |
18
|
|
|
|
|
|
|
{ |
19
|
6
|
|
|
6
|
0
|
2226
|
my ($self, $class) = @_; |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
|
|
|
9
|
return @{$self->_guide->{$class}}; |
|
6
|
|
|
|
|
28
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get_all_of_type |
25
|
|
|
|
|
|
|
{ |
26
|
3
|
|
|
3
|
0
|
12136
|
my ($self, $obj) = @_; |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
|
|
13
|
my $class = $self->legend->get_class_of_object($obj); |
29
|
3
|
|
|
|
|
34
|
my @all_of_class = $self->get_all_of_class($class); |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
15
|
return grep { $_->type eq $obj } @all_of_class; |
|
12
|
|
|
|
|
40
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|