TileMap/Role/Helpers.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 2 totaltotal 94.7% 36 / 38 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« TileMap/_Utils.pm ↑ Summary TileMap/Tile.pm »
1 package Game::TileMap::Role::Helpers;
2 2 $Game::TileMap::Role::Helpers::VERSION = '0.002';
3 2 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Mooish::AttributeBuilder -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Game::TileMap::Legend;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 requires qw(
13 legend
14 _guide
15 );
16  
17 sub get_all_of_class
18 {
19 6 ▶ my ($self, $class) = @_;
Subroutine get_all_of_class: called CC=1 SCAR=0.0
Pod undocumented
20  
21 6 return @{$self->_guide->{$class}};
22 }
23  
24 sub get_all_of_type
25 {
26 3 ▶ my ($self, $obj) = @_;
Subroutine get_all_of_type: called CC=1 SCAR=0.0
Pod undocumented
27  
28 3 my $class = $self->legend->get_class_of_object($obj);
29 3 my @all_of_class = $self->get_all_of_class($class);
30  
31 3 return grep { $_->type eq $obj } @all_of_class;
32 }
33  
34 2 1;
35  
« TileMap/_Utils.pm ↑ Summary TileMap/Tile.pm »