« Games/AssaultCube/Log/Line/Base/GameMode.pm
↑ Summary
Games/AssaultCube/Log/Line/Base/TeamInfo.pm »
| 1 | # the "roleinfo" role | ||||||||||||||||||||||||||||
| 2 | package Games::AssaultCube::Log::Line::Base::RoleInfo; | ||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | # Initialize our version | ||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use vars qw( $VERSION ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | $VERSION = '0.04'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Games::AssaultCube::Utils qw( get_role_from_name get_role_name ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | has 'role' => ( | ||||||||||||||||||||||||||||
| 12 | isa => 'Int', | ||||||||||||||||||||||||||||
| 13 | is => 'ro', | ||||||||||||||||||||||||||||
| 14 | lazy => 1, | ||||||||||||||||||||||||||||
| 15 | 7 | ▶ | default => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 7 | my $self = shift; | |||||||||||||||||||||||||||
| 17 | 7 | return get_role_from_name( $self->role_name ); | |||||||||||||||||||||||||||
| 18 | }, | ||||||||||||||||||||||||||||
| 19 | 2 | ); | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | has 'role_name' => ( | ||||||||||||||||||||||||||||
| 22 | isa => 'Str', | ||||||||||||||||||||||||||||
| 23 | is => 'ro', | ||||||||||||||||||||||||||||
| 24 | lazy => 1, | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | default => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 26 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 27 | 0 | return get_role_name( $self->role ); | |||||||||||||||||||||||||||
| 28 | }, | ||||||||||||||||||||||||||||
| 29 | 2 | ); | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 2 | ▶ | sub BUILD { | ||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=3 SCAR=13.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 32 | 2 | my $self = shift; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | # check role | ||||||||||||||||||||||||||||
| 35 | 2 | ▶ | if ( ! exists $self->{'role'} and ! exists $self->{'role_name'} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $self->{"role"} or exists $self->{"role_name"}
MC/DC0%0/2
exists $self->{"role"} or exists $self->{"role_name"}
exists $self->{"role"}
exists $self->{"role_name"}
Truth table33%1/3
A or B
A= exists $self->{"role"}B= exists $self->{"role_name"}
| |||||||||||||||||||||||||||||
| 36 | 0 | die "Role information is missing"; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | 2 | return; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 2 | 1; | |||||||||||||||||||||||||||
| 42 | __END__ | ||||||||||||||||||||||||||||