File Coverage

lib/BalanceOfPower/Commands/Role/TreatiesUnderLimit.pm
Criterion Covered Total %
statement 17 17 100.0
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 22 24 91.6


line stmt bran cond sub pod time code
1             package BalanceOfPower::Commands::Role::TreatiesUnderLimit;
2             $BalanceOfPower::Commands::Role::TreatiesUnderLimit::VERSION = '0.400115';
3 13     13   5267 use strict;
  13         22  
  13         375  
4 13     13   140 use v5.10;
  13         49  
5 13     13   44 use Moo::Role;
  13         17  
  13         87  
6              
7             sub nations_under_treaty_limit
8             {
9 9     9 0 15 my $self = shift;
10 9         19 my @targets = @_;
11 9         18 my @out = ();
12 9         21 for(@targets)
13             {
14 24         24 my $nation_name = $_;
15 24         81 my $n = $self->world->get_nation($nation_name);
16 24 50       77 if($self->world->get_treaties_for_nation($n->name) < $n->treaty_limit)
17             {
18 24         56 push @out, $nation_name;
19             }
20             }
21 9         46 return @out;
22             }
23              
24             1;