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.400105';
3 13     13   4071 use strict;
  13         18  
  13         274  
4 13     13   105 use v5.10;
  13         29  
5 13     13   39 use Moo::Role;
  13         15  
  13         70  
6              
7             sub nations_under_treaty_limit
8             {
9 12     12 0 15 my $self = shift;
10 12         19 my @targets = @_;
11 12         16 my @out = ();
12 12         23 for(@targets)
13             {
14 26         27 my $nation_name = $_;
15 26         65 my $n = $self->world->get_nation($nation_name);
16 26 50       71 if($self->world->get_treaties_for_nation($n->name) < $n->treaty_limit)
17             {
18 26         50 push @out, $nation_name;
19             }
20             }
21 12         38 return @out;
22             }
23              
24             1;