File Coverage

lib/BalanceOfPower/Commands/EconomicAid.pm
Criterion Covered Total %
statement 3 12 25.0
branch 0 2 0.0
condition n/a
subroutine 1 2 50.0
pod 0 1 0.0
total 4 17 23.5


line stmt bran cond sub pod time code
1             package BalanceOfPower::Commands::EconomicAid;
2             $BalanceOfPower::Commands::EconomicAid::VERSION = '0.400105';
3 13     13   43 use Moo;
  13         16  
  13         59  
4              
5              
6             extends 'BalanceOfPower::Commands::TargetNation';
7              
8             sub IA
9             {
10 0     0 0   my $self = shift;
11 0           my $actor = $self->get_nation();
12              
13 0           my @hates = $self->world->get_hates($actor->name);
14 0 0         if(@hates)
15             {
16             #Minor hate is used
17 0           @hates = sort { $b->factor <=> $a->factor } @hates;
  0            
18 0           my $other = $hates[0]->destination($actor->name);
19 0           return "ECONOMIC AID FOR $other";
20             }
21 0           return undef;
22             }
23              
24             1;