TileMap/Tile.pm

filter: Statementstmt 100% 27 / 27 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 94.4% 34 / 36 CC 2 SCAR 2.5
CC
2
Cov
97%
BUILD
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« TileMap/Legend.pm ↑ Summary TileMap/Role/Helpers.pm »
1 package Game::TileMap::Tile;
2 4 $Game::TileMap::Tile::VERSION = '1.001';
3 4 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use Mooish::Base -standard;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 has param ['x', 'y'] => (
11 isa => PositiveOrZeroInt,
12 );
13  
14 4 has param 'contents' => (
15 isa => Any,
16 writer => 1,
17 );
18  
19 4 has field 'is_wall' => (
20 isa => Bool,
21 writer => -hidden,
22 );
23  
24 4 has field 'is_void' => (
25 isa => Bool,
26 writer => -hidden,
27 );
28  
29 4 has field 'type' => (
30 isa => Any,
31 writer => -hidden,
32 );
33  
34 sub BUILD
35 195 ▶{
Subroutine BUILD: called CC=2 SCAR=7.0
Pod undocumented
36 195 my ($self, $args) = @_;
37  
38 195 my $legend = $args->{legend};
39 195 ▶ croak "argument legend is required for Game::TileMap::Tile"
Branch: 1 branch
BranchTrueFalseTotal
unless $legend 0 195 195
40 unless $legend;
41  
42 195 $self->_set_type($self->contents);
43 195 $self->_set_is_void($legend->voids->{$self->type});
44 195 $self->_set_is_wall($legend->walls->{$self->type});
45 }
46  
47 4 1;
48  
49 __END__
« TileMap/Legend.pm ↑ Summary TileMap/Role/Helpers.pm »