| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Games::Lacuna::Task::Role::Intelligence; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1585
|
use 5.010; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
57
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = $Games::Lacuna::Task::VERSION; |
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
414
|
use Moose::Role; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub assigned_to_type { |
|
9
|
|
|
|
|
|
|
my ($self,$assigned_to) = @_; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
return 'own' |
|
12
|
|
|
|
|
|
|
if $assigned_to->{body_id} ~~ [ $self->my_bodies ]; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
my $body_data = $self->get_body_by_id($assigned_to->{body_id}); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
return 'unknown' |
|
17
|
|
|
|
|
|
|
unless defined $body_data |
|
18
|
|
|
|
|
|
|
&& defined $body_data->{empire}; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return $body_data->{empire}{alignment}; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
no Moose::Role; |
|
24
|
|
|
|
|
|
|
1; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=encoding utf8 |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 NAME |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Games::Lacuna::Task::Role::Intelligence -Â Helper methods for intelligence |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
package Games::Lacuna::Task::Action::MyTask; |
|
35
|
|
|
|
|
|
|
use Moose; |
|
36
|
|
|
|
|
|
|
extends qw(Games::Lacuna::Task::Action); |
|
37
|
|
|
|
|
|
|
with qw(Games::Lacuna::Task::Role::Intelligence); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
This role provides intelligence-related helper methods. |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 METHODS |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 assigned_to_type |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |