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

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 28 CC 2 SCAR 13.9
CC
2
Cov
0%
IA
6.0
get_available_targets
2.0
BEGIN
2.0
CRAP 4.0
1 package BalanceOfPower::Commands::DiplomaticPressure;
2 $BalanceOfPower::Commands::DiplomaticPressure::VERSION = '0.300010';
3 use Moo;
4  
5 extends 'BalanceOfPower::Commands::TargetNation';
6  
7 sub get_available_targets
8 {
9 my $self = shift;
10 my @targets = $self->SUPER::get_available_targets();
11 my $nation = $self->actor;
12 @targets = grep { (! $self->world->is_under_influence($_)
13 || $self->world->is_under_influence($_) ne $nation) } @targets;
14 return @targets;
15 }
16  
17  
18 sub IA
19 {
20 my $self = shift;
21 my $actor = $self->get_nation();
22 my @hates = $self->world->shuffle("Choosing target for diplomatic pressure for ". $self->actor, $self->world->get_nations_with_status($self->actor, ['HATE']));
23 if(@hates)
24 {
25 return "DIPLOMATIC PRESSURE ON " . $hates[0];
26 }
27 else
28 {
29 return undef;
30 }
31 }
32 1;