Branch Coverage

blib/lib/Game/TextMapper/Folkesten.pm
Criterion Covered Total %
branch 70 114 61.4


line true false branch
105 0 1692 unless defined $i
106 1692 0 unless ref $hex
144 1762 0 unless defined $y
145 1571 93 if $x > 0 and $x <= $self->width and $y > 0 and $y <= $self->height
194 1 0 if $edges < 0
197 0 0 if ($edge eq 'west') { }
0 0 elsif ($edge eq 'east') { }
0 0 elsif ($edge eq 'north') { }
0 0 elsif ($edge eq 'south') { }
218 0 0 if ($self->world->{$other} ne "ocean" and rand() < "0.333333333333333")
227 0 0 if $seen{$other}
229 0 0 if ($self->world->{$other} ne "ocean" and rand() < "0.5")
235 0 0 if $self->world->{$_} ne "ocean"
0 0 if (&any(sub { $self->world->{$_} ne "water" if $self->world->{$_} ne "ocean"; } , $self->all_neighbors($hex)))
260 5 0 if ($self->world->{$coord} eq "plain")
269 30 164 if ($self->world->{$other} eq "plain")
270 12 18 if ($chance and rand() < $chance) { }
281 15 80 if ($self->world->{$other} eq "plain")
310 1 16 if $seen{$hex}
318 226 8 unless not $self->legal($_)
319 8 35 if ($end)
327 9 26 if ($seen{$next})
333 0 1 if ($seen{$next}) { }
343 8 1 if (@other > 0)
344 2 6 if ($other[0] eq $next) { }
357 0 1 unless ($next)
385 2 12 unless @$river > 2
390 6 47 if ($seen{$hex})
391 6 0 if (@$canyon == 0) { }
0 0 elsif ($seen{$hex} == 1) { }
0 0 elsif ($seen{$hex} > 1) { }
409 0 47 if ($self->legal($hex) and $self->altitude->{$self->world->{$hex}} > $current_altitude) { }
0 47 elsif (@$canyon > 0) { }
41 6 elsif ($self->legal($hex)) { }
410 0 0 if (@$canyon > 0) { }
442 1 0 rand() < 0.5 ? :
443 0 1 $dir == 1 ? :
444 0 1 $dir == 1 ? :
447 0 110 $dir == 1 ? :
449 6 94 if (not $dry and $self->world->{$hex} eq 'mountain') { }
16 78 elsif ($dry) { }
450 0 6 $dir == 1 ? :
459 6 3 $dry % 2 ? :
9 7 if abs($x - $dry) % 2
461 22 3 if $self->wet->{$hex2}
480 100 0 if $self->world->{$_} ne "water"
483 29 71 if ($self->wet->{$hex} and rand() < "0.5" or not $self->dry->{$hex} || &any(sub { $self->dry->{$_}; } , $self->all_neighbors($hex)) and rand() < "0.166666666666667")
487 12 17 if ($self->world->{$hex} eq 'plain') { }
11 6 elsif ($self->world->{$hex} eq 'hills') { }
498 15 82 if (not $self->dry->{$hex} and &any(sub { $forest_hexes{$_}; } , $self->all_neighbors($hex)) and rand() < "0.333333333333333")
501 4 11 if ($self->world->{$hex} eq 'plain') { }
5 6 elsif ($self->world->{$hex} eq 'hills') { }
518 34 66 if $self->world->{$_} eq "plain"
519 0 6 if &any(sub { $self->dry->{$_}; } , $self->all_neighbors($hex))
520 1 5 if (rand() < "0.166666666666667")
534 100 0 unless $self->world->{$_} eq "water"
535 0 0 if (rand() < "0.166666666666667")