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