« blib/lib/BalanceOfPower/Commands/ComTreaty.pm
↑ Summary
blib/lib/BalanceOfPower/Nation/Role/Shareholder.pm »
| 1 | package BalanceOfPower::Commands::Role::TreatiesUnderLimit; | ||
| 2 | $BalanceOfPower::Commands::Role::TreatiesUnderLimit::VERSION = '0.200000'; | ||
| 3 | use strict; | ||
| 4 | use v5.10; | ||
| 5 | use Moo::Role; | ||
| 6 | |||
| 7 | sub nations_under_treaty_limit | ||
| 8 | { | ||
| 9 | my $self = shift; | ||
| 10 | my @targets = @_; | ||
| 11 | my @out = (); | ||
| 12 | for(@targets) | ||
| 13 | { | ||
| 14 | my $nation_name = $_; | ||
| 15 | my $n = $self->world->get_nation($nation_name); | ||
| 16 | if($self->world->get_treaties_for_nation($n->name) < $n->treaty_limit) | ||
| 17 | { | ||
| 18 | push @out, $nation_name; | ||
| 19 | } | ||
| 20 | } | ||
| 21 | return @out; | ||
| 22 | } | ||
| 23 | |||
| 24 | 1; |