« blib/lib/BalanceOfPower/Role/Historian.pm
↑ Summary
blib/lib/BalanceOfPower/Commands/RebelMilitarySupport.pm »
| 1 | package BalanceOfPower::Relations::Treaty; | ||||||||||||||||||
| 2 | 11 | $BalanceOfPower::Relations::Treaty::VERSION = '0.300010'; | |||||||||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 4 | 11 | ▶ | use v5.10; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 5 | |||||||||||||||||||
| 6 | 11 | ▶ | use Moo; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 7 | |||||||||||||||||||
| 8 | 11 | with 'BalanceOfPower::Relations::Role::Relation'; | |||||||||||||||||
| 9 | |||||||||||||||||||
| 10 | 11 | has type => ( | |||||||||||||||||
| 11 | is => 'ro', | ||||||||||||||||||
| 12 | ); | ||||||||||||||||||
| 13 | |||||||||||||||||||
| 14 | around 'print' => sub { | ||||||||||||||||||
| 15 | 0 | ▶ | my $orig = shift; | ||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||
| 16 | 0 | my $self = shift; | |||||||||||||||||
| 17 | 0 | return $self->short_tag . ": " . | |||||||||||||||||
| 18 | $self->$orig(); | ||||||||||||||||||
| 19 | 11 | }; | |||||||||||||||||
| 20 | |||||||||||||||||||
| 21 | sub short_tag | ||||||||||||||||||
| 22 | { | ||||||||||||||||||
| 23 | 0 | ▶ | my $self = shift; | ||||||||||||||||
|
Subroutine
short_tag: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||
| 24 | 0 | ▶ | if($self->type eq 'alliance') | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 25 | { | ||||||||||||||||||
| 26 | 0 | return 'ALL'; | |||||||||||||||||
| 27 | } | ||||||||||||||||||
| 28 | elsif($self->type eq 'no aggression') | ||||||||||||||||||
| 29 | { | ||||||||||||||||||
| 30 | 0 | return 'NAG'; | |||||||||||||||||
| 31 | } | ||||||||||||||||||
| 32 | elsif($self->type eq 'commercial') | ||||||||||||||||||
| 33 | { | ||||||||||||||||||
| 34 | 0 | return 'COM'; | |||||||||||||||||
| 35 | } | ||||||||||||||||||
| 36 | else | ||||||||||||||||||
| 37 | { | ||||||||||||||||||
| 38 | 0 | return '???'; | |||||||||||||||||
| 39 | } | ||||||||||||||||||
| 40 | |||||||||||||||||||
| 41 | } | ||||||||||||||||||
| 42 | sub dump | ||||||||||||||||||
| 43 | { | ||||||||||||||||||
| 44 | 0 | ▶ | my $self = shift; | ||||||||||||||||
|
Subroutine
dump: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||
| 45 | 0 | my $io = shift; | |||||||||||||||||
| 46 | 0 | ▶ | my $indent = shift || ""; | ||||||||||||||||
|
Condition0%0/2
shift() || ''
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||||||||
| 47 | 0 | print {$io} $indent . join(";", $self->node1, $self->node2, $self->type) . "\n"; | |||||||||||||||||
| 48 | } | ||||||||||||||||||
| 49 | sub load | ||||||||||||||||||
| 50 | { | ||||||||||||||||||
| 51 | 0 | ▶ | my $self = shift; | ||||||||||||||||
|
Subroutine
load: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||
| 52 | 0 | my $data = shift; | |||||||||||||||||
| 53 | 0 | $data =~ s/^\s+//; | |||||||||||||||||
| 54 | 0 | chomp $data; | |||||||||||||||||
| 55 | 0 | my ($node1, $node2, $type) = split ";", $data; | |||||||||||||||||
| 56 | 0 | return $self->new(node1 => $node1, node2 => $node2, type => $type); | |||||||||||||||||
| 57 | } | ||||||||||||||||||
| 58 | |||||||||||||||||||
| 59 | 11 | 1; | |||||||||||||||||