blib/lib/BalanceOfPower/Commands/InMilitaryRange.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 CC 5 SCAR 32.3
CC
5
Cov
0%
get_available_targets
30.0
BEGIN
2.0
CRAP 25.3
1 package BalanceOfPower::Commands::InMilitaryRange;
2 $BalanceOfPower::Commands::InMilitaryRange::VERSION = '0.300010';
3 use Moo;
4  
5 extends 'BalanceOfPower::Commands::TargetNation';
6  
7 has crisis_needed => (
8 is => 'ro',
9 default => 0
10 );
11  
12 sub get_available_targets
13 {
14 my $self = shift;
15 my $player = $self->actor;
16 my @out = ();
17 for($self->SUPER::get_available_targets())
18 {
19 my $n = $_;
20 my $push = 0;
21 if($self->world->in_military_range($player, $n))
22 {
23 if($self->crisis_needed)
24 {
25 if($self->world->crisis_exists($player, $n))
26 {
27 $push = 1;
28 }
29 }
30 else
31 {
32 $push = 1;
33 }
34 }
35 if($push)
36 {
37 push @out, $n;
38 }
39 }
40 return @out;
41 }
42  
43 1;