| 1 | package Game::TileMap::Role::Checks; | ||||||||||||||||||||||||||||||||||
| 2 | 4 | $Game::TileMap::Role::Checks::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 -stardard, -role; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||
| 9 | 4 | requires qw( | |||||||||||||||||||||||||||||||||
| 10 | get_tile | ||||||||||||||||||||||||||||||||||
| 11 | ); | ||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||
| 13 | sub check_within_map | ||||||||||||||||||||||||||||||||||
| 14 | 15 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
check_within_map: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 15 | 15 | my ($self, $x, $y) = @_; | |||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||
| 17 | 15 | my $obj = $self->get_tile($x, $y); | |||||||||||||||||||||||||||||||||
| 18 | 15 | ▶ | return $obj && !$obj->is_wall; | ||||||||||||||||||||||||||||||||
|
Condition100%3/3
$obj && !$obj->is_wall
MC/DC100%2/2
$obj && !$obj->is_wall
$obj
!$obj->is_wall
Truth table100%3/3
A && not(B)
A= $objB= !$obj->is_wall
| |||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||
| 21 | sub check_can_be_accessed | ||||||||||||||||||||||||||||||||||
| 22 | 13 | ▶ | { | ||||||||||||||||||||||||||||||||
|
Subroutine
check_can_be_accessed: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 23 | 13 | my ($self, $x, $y) = @_; | |||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||
| 25 | 13 | my $obj = $self->get_tile($x, $y); | |||||||||||||||||||||||||||||||||
| 26 | 13 | ▶ | return $obj && !$obj->is_wall && !$obj->is_void; | ||||||||||||||||||||||||||||||||
|
Condition100%6/6
$obj && !$obj->is_wall && !$obj->is_void
$obj and not $obj->is_wall
MC/DC100%3/3
$obj && !$obj->is_wall && !$obj->is_void
$obj
not $obj->is_wall
!$obj->is_void
Truth table100%4/4
A and not(B) && not(C)
A= $objB= not $obj->is_wallC= !$obj->is_void
| |||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||
| 29 | 4 | 1; | |||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||