lib/BalanceOfPower/Commands/InMilitaryRange.pm

filter: Statementstmt 33.3% 7 / 21 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 1 / 2 Podpod 0.0% 0 / 1 totaltotal 25.0% 8 / 32 CC 6 SCAR 35.9
CC
6
Cov
24%
get_available_targets
42.0
BEGIN
1.0
CRAP 36.1
« lib/BalanceOfPower/Role/Merchant.pm ↑ Summary lib/BalanceOfPower/Role/Reporter.pm »
1 package BalanceOfPower::Commands::InMilitaryRange;
2 11 $BalanceOfPower::Commands::InMilitaryRange::VERSION = '0.300010';
3 11 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 11 extends 'BalanceOfPower::Commands::TargetNation';
6  
7 11 has crisis_needed => (
8 is => 'ro',
9 default => 0
10 );
11  
12 sub get_available_targets
13 {
14 0 ▶ my $self = shift;
Subroutine get_available_targets: not called CC=6 SCAR=37.4
Pod undocumented
15 0 my $player = $self->actor;
16 0 my @out = ();
17 0 for($self->SUPER::get_available_targets())
18 {
19 0 my $n = $_;
20 0 my $push = 0;
21 0 ▶ if($self->world->in_military_range($player, $n))
Branch: 1 branch
BranchTrueFalseTotal
if ($self->world->in_military_range($player, $n)) 0 0 0
22 {
23 0 ▶ if($self->crisis_needed)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->crisis_needed) { } 0 0 0
24 {
25 0 ▶ if($self->world->crisis_exists($player, $n))
Branch: 1 branch
BranchTrueFalseTotal
if ($self->world->crisis_exists($player, $n)) 0 0 0
26 {
27 0 $push = 1;
28 }
29 }
30 else
31 {
32 0 $push = 1;
33 }
34 }
35 0 ▶ if($push)
Branch: 1 branch
BranchTrueFalseTotal
if ($push) 0 0 0
36 {
37 0 push @out, $n;
38 }
39 }
40 0 return @out;
41 }
42  
43 11 1;
« lib/BalanceOfPower/Role/Merchant.pm ↑ Summary lib/BalanceOfPower/Role/Reporter.pm »