Branch Coverage

blib/lib/Games/Roguelike/Area.pm
Criterion Covered Total %
branch 182 414 43.9


line true false branch
86 0 16 unless $pkg
97 0 16 if $opts{'world'} and not $opts{'name'}
106 16 0 if (not $opts{'world'}) { }
125 16 0 unless defined $$self{'memcolor'}
126 16 0 unless $$self{'nomove'}
127 16 0 unless $$self{'noview'}
128 0 16 if ($$self{'world'})
130 0 0 if not $$self{'world'}->area
138 0 0 unless $$self{'name'}
140 0 0 if ($$self{'world'} != $world)
141 0 0 if $$self{'world'}
145 0 0 unless defined $$self{$_}
154 0 0 unless my $pkg = ref $self
159 0 0 if @_ and not exists $$self{$name}
161 0 0 unless (exists $$self{$name})
165 0 0 if (@_) { }
213 0 0 if (ref $sym) { }
215 0 0 if defined $$sym{'color'}
218 0 0 if defined $color
225 0 0 if ($s) { }
235 0 0 if ($c) { }
244 1 0 if (@_) { }
260 0 41 unless $self
272 0 0 unless $self
276 0 0 if $$self{'map'}[$x][$y] eq ''
289 0 0 if ($x =~ /^[a-z]/i)
293 0 0 unless (defined $x)
304 0 0 if $opts{'minw'} and $rw < $opts{'minw'}
305 0 0 if $opts{'minh'} and $rh < $opts{'minh'}
306 0 0 if $opts{'maxw'} and $rw > $opts{'maxw'}
307 0 0 if $opts{'maxh'} and $rh > $opts{'maxh'}
316 0 0 unless ($rh and $rw)
321 0 0 if ($opts{'nooverlap'})
324 0 0 if ($$m[$rx + $i][int $ry + $i * $rw / $rh])
329 0 0 if ($rw <= 1 or $rh <= 1)
336 0 0 if ($x > $rx + $rw or $y > $ry + $rh)
341 0 0 if $rx + $i < 0
342 0 0 unless $$m[$rx + $i][$ry - 1] or $ry == 0
343 0 0 unless $$m[$rx + $i][$ry + $rh]
347 0 0 unless $$m[$rx + $i][$ry + $j]
351 0 0 if $ry + $i < 0
352 0 0 unless $$m[$rx - 1][$ry + $i] or $rx == 0
353 0 0 unless $$m[$rx + $rw][$ry + $i]
355 0 0 if ($opts{'door'})
356 0 0 if (rand() > 0.5) { }
357 0 0 if (rand() > 0.5) { }
364 0 0 if (rand() > 0.5) { }
398 0 40 if $x1 == $x2 and $y1 == $y2
410 0 43648 if $tx < 0 or $ty < 0
411 0 43648 if $tx >= $$self{'w'} or $ty >= $$self{'h'}
414 0 43648 unless defined $$self{'map'}[$tx][$ty]
415 0 43648 if $$self{'map'}[$tx][$ty] eq ''
418 17213 26435 if index($$self{'nomove'}, $$self{'map'}[$tx][$ty]) >= 0
420 19294 7141 if $bread[$tx][$ty]
423 26 7115 if $tx == $x2 and $ty == $y2
459 0 49496 if $tx < 0 or $ty < 0
460 0 49496 if $tx >= $$self{'w'} or $ty >= $$self{'h'}
463 0 49496 if not defined $$self{'map'}[$tx][$ty] or $$self{'map'}[$tx][$ty] eq ''
466 18424 31072 if index($$self{'nomove'}, $$self{'map'}[$tx][$ty]) >= 0
468 24218 6854 if $bread[$tx][$ty]
471 14 6840 if $tx == $x2 and $ty == $y2
473 776 6064 if ((my $tdist = distance($tx, $ty, $x2, $y2)) < $mindist)
514 0 217 if not defined $$self{'map'}[$tx][$ty] or $$self{'map'}[$tx][$ty] eq ''
517 88 129 if index($$self{'nomove'}, $$self{'map'}[$tx][$ty]) >= 0
520 0 129 if $tx < 0 or $ty < 0
521 0 129 if $tx >= $$self{'w'} or $ty > $$self{'h'}
551 2937 0 unless $ws
552 2937 0 unless $fs
554 0 2937 if $x <= 0 or $y <= 0
555 0 2937 if $x >= $$self{'w'} - 1 or $y >= $$self{'h'} - 1
558 166 2736 unless not defined $c or $c eq $ws or $c eq ''
565 16625 5543 unless not defined $c or $c eq ''
592 0 0 if index($sym, $$self{'map'}[$tx][$ty]) >= 0
620 33 231 if (not defined $cur) { }
624 114 117 if ($cur != $wl)
631 10 23 if ($cur != $first)
651 29 4 if ($self->okdoor($x, $y) and $$self{'dsym'})
661 0 32 unless $$self{'wsym'} and $$self{'fsym'}
669 0 32 if ($$self{'map'}[$x][$y] eq '')
672 0 32 if ($$self{'map'}[$x2][$y2] eq '')
677 8 24 if ($y < $y2) { }
13 11 elsif ($y > $y2) { }
683 7 25 if ($x < $x2) { }
15 10 elsif ($x > $x2) { }
689 10 22 unless $d
707 11 11 if ($d =~ /^n|s$/) { }
718 1 31 unless $d
720 0 31 if $self->debug > 1
722 16 15 if ($d =~ /^n|s$/) { }
737 303 26 if ($iswall or $$self{'map'}[$x][$y] eq '') { }
739 17 286 if ($firstdig)
746 16 10 if ($waswall) { }
756 43 286 if ($already_dug)
758 18 25 if (&distance($fx, $fy, $x, $y) >= 2)
763 4 21 if $dist == 0
768 0 307 if $x <= 1 or $y <= 1 or $x >= $$self{'w'} - 1 or $y >= $$self{'h'} - 1
770 2 11 if $x == $x2 and $y == $y2
774 0 4 unless ($self->findpath($ox, $oy, $x2, $y2))
794 0 0 unless $$self{'wsym'} and $$self{'fsym'}
804 0 0 if ($y < $y2) { }
0 0 elsif ($y > $y2) { }
809 0 0 if ($x < $x2) { }
0 0 elsif ($x > $x2) { }
833 0 0 if ($$self{'map'}[$fx][$fy] eq $sym)
849 0 0 unless (defined $x)
902 0 2 if (defined &$path)
907 2 0 unless ($type =~ /::/)
911 2 0 if (defined &$path)
951 0 41 if (my $feature = shift @{$opts{'with'};}) { }
965 2593 1376 if (not $v[$tx][$ty] and $self->diginbound($tx, $ty))
967 2429 164 if $self->digone($cx, $cy)
982 36 5 if ($px)
983 14 22 unless ($self->findpath($x, $y, $px, $py))
1013 0 0 if $self->genroom($fx, $fy)
1018 0 0 if $self->genroom(($fx, $fy) = $self->rpoint_empty, 'nooverlap', 1)
1025 0 0 if ($px)
1026 0 0 unless ($self->findpath($x, $y, $px, $py))
1028 0 0 unless ($self->findpath($x, $y, $px, $py))
1052 0 0 unless $opts{'w'}
1053 0 0 unless $opts{'h'}
1064 0 0 unless $opts{'rand'}
1066 0 0 unless $opts{'w'} % 2
1067 0 0 unless $opts{'h'} % 2
1079 0 0 unless $intDone
1081 0 0 if ($blnMaze[$cSx][$cSy])
1086 0 0 unless int $opts{'rand'} * (rand())
1095 0 0 if ($cNx < $opts{'w'} - 1 and $cNx >= 1 and $cNy < $opts{'h'} - 1 and $cNy >= 1)
1099 0 0 if ($isFree)
1135 0 0 $blnMaze[$x][$y] ? :
1162 0 0 if ($opts{'border'}) { }
1176 0 0 if ($opts{'nobodrder'})
1217 0 3 if ($$self{'debugmap'})
1224 3 0 if ($vp)
1227 1 2 if $ox < 0
1228 1 2 if $oy < 0
1229 0 3 if $ox + $dispw > $$self{'w'}
1230 0 3 if $oy + $disph > $$self{'h'}
1234 0 3 if ($$self{'debugmap'})
1255 0 54 if ($$self{'debugmap'})
1259 186 1974 if (my $memtyp = $self->checkmap($vp, $x, $y, $$self{'map'}[$x][$y])) { }
1261 186 0 $$self{'map'}[$x][$y] ? :
0 186 $memtyp == 2 ? :
1262 0 186 if $memtyp == 2 and $$self{'memcolor'}
1298 3 0 if ($self->checkpov($vp, $$ob{'x'}, $$ob{'y'}))
1299 3 0 if ($$ob{'y'} - $oy >= 0 and $$ob{'x'} - $ox >= 0 and $$ob{'x'} - $ox < $$opts{'dispw'} and $$ob{'y'} - $oy < $$opts{'disph'})
1303 0 3 if ($vp and $ob != $vp and not $$vp{'memory'}{$$self{'name'}}[$$ob{'x'}][$$ob{'y'}] eq $$ob{'sym'})
1327 1 0 if $$m{'x'} == $x and $$m{'y'} == $y
1339 0 0 if (not @_) { }
1345 0 0 if $$i{'x'} == $x and $$i{'y'} == $y
1359 0 0 if (not @_) { }
1365 0 0 if $$m{'x'} == $x and $$m{'y'} == $y
1383 0 2171 unless $vp
1384 0 2171 if $$vp{'pov'} < 0 or not defined $$vp{'pov'}
1385 0 2171 if $$vp{'pov'} == 0
1391 1569 602 unless $dist <= $$vp{'pov'}
1393 18 584 if $dist <= 1
1395 0 584 if $$self{'debugfov'}
1396 0 584 if ($OKINLINEPOV)
1397 0 0 if $$self{'debugfov'}
1398 0 0 $$self{'debugfov'} ? :
1427 3250 8866 unless $ok[$j]
1428 455 8411 if (int $x[$j] eq $x and int $y[$j] eq $y)
1429 0 455 if $$self{'debugfov'}
1432 7441 0 if ($dx != 0 and $dy != 0 and abs $dx / $dy > 0.1 and abs $dy / $dx > 0.1)
1434 78 836 if (round($x[$j]) eq $x and round($y[$j]) eq $y and $i >= $dist - 1)
1435 0 78 if $$self{'debugfov'}
1439 1866 6467 if ($$self{'map'}[$x[$j]][$y[$j]] =~ /^(#|\+)$/) { }
1441 0 1866 if $$self{'debugfov'}
1443 0 6467 if $$self{'debugfov'}
1446 410 81 unless $ok[0] or $ok[1] or $ok[2] or $ok[3]
1464 2160 0 if ($vp and $$vp{'hasmem'}) { }
1465 186 1974 if ($self->checkpov($vp, $x, $y))
1470 0 1974 if $$vp{'memory'}{$$self{'name'}}[$x][$y]
1487 0 1 if $_ eq $m
1504 1 0 if $_ == $m
1524 2748 0 if defined $$self{'map'}[$x][$y] and ($$self{'map'}[$x][$y] eq $sym and $mobok || !$self->mobat($x, $y))
1551 0 0 if ($$self{'map'}[$x][$y])
1552 0 0 if $x < $mx
1553 0 0 if $y < $my
1554 0 0 if $x > $xx
1555 0 0 if $y > $xy
1566 0 0 $$self{'map'}[$x][$y] ? :
1587 1 0 if ($item->setcont($self))
1588 0 1 unless (defined $$item{'x'})
1606 0 0 if $_ == $ob
1705 0 2 unless @_
1715 0 2 if (@_ == 1) { }
1722 0 2 if ($fn) { }
1734 1 1 if $opts{'key'}
1735 1 1 if $opts{'lib'}
1740 0 2 if ($opts{'yxarray'} and ref $opts{'yxarray'}) { }
1743 0 2 unless ($map)
1767 4 67 if ($opt) { }
1768 2 2 if ($$opt{'sym'})
1771 3 1 if ($$opt{'class'}) { }
1776 0 3 unless $ob
1777 1 2 if (ref $$opt{'items'} eq 'ARRAY')
1779 1 2 if (not ref $_) { }
1787 0 3 unless $ob
1791 0 1 if ($$opt{'feature'})
1818 0 9 unless $hash
1819 0 9 if $$hash{'__lib__'}
1820 7 2 unless my $libname = $$hash{'lib'}
1822 0 2 unless $$lib{$libname}
1829 0 15 if $_ eq 'lib'
1837 67 5 unless $$key{$index}
1844 0 0 if ($$self{'world'}) { }