| 1 | # The "teaminfo" role | ||||||||||||||||||||||||||||
| 2 | package Games::AssaultCube::Log::Line::Base::TeamInfo; | ||||||||||||||||||||||||||||
| 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_team_from_name get_team_name ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | has 'team' => ( | ||||||||||||||||||||||||||||
| 12 | isa => 'Int', | ||||||||||||||||||||||||||||
| 13 | is => 'ro', | ||||||||||||||||||||||||||||
| 14 | lazy => 1, | ||||||||||||||||||||||||||||
| 15 | 9 | ▶ | default => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 9 | my $self = shift; | |||||||||||||||||||||||||||
| 17 | 9 | return get_team_from_name( $self->team_name ); | |||||||||||||||||||||||||||
| 18 | }, | ||||||||||||||||||||||||||||
| 19 | 2 | ); | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | has 'team_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_team_name( $self->team ); | |||||||||||||||||||||||||||
| 28 | }, | ||||||||||||||||||||||||||||
| 29 | 2 | ); | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 4 | ▶ | sub BUILD { | ||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=3 SCAR=13.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 32 | 4 | my $self = shift; | |||||||||||||||||||||||||||
| 33 | 4 | ▶ | if ( ! exists $self->{'team'} and ! exists $self->{'team_name'} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $self->{"team"} or exists $self->{"team_name"}
MC/DC0%0/2
exists $self->{"team"} or exists $self->{"team_name"}
exists $self->{"team"}
exists $self->{"team_name"}
Truth table33%1/3
A or B
A= exists $self->{"team"}B= exists $self->{"team_name"}
| |||||||||||||||||||||||||||||
| 34 | 0 | die "Team information is missing"; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | 4 | return; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 2 | 1; | |||||||||||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||||||||||