| 1 | # Declare our package | ||||||||||
| 2 | package Games::AssaultCube::Log::Line::TeamStatus; | ||||||||||
| 3 | |||||||||||
| 4 | # import the Moose stuff | ||||||||||
| 5 | 2 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | # Initialize our version | ||||||||||
| 8 | 2 | ▶ | use vars qw( $VERSION ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | $VERSION = '0.04'; | |||||||||
| 10 | |||||||||||
| 11 | 2 | extends 'Games::AssaultCube::Log::Line::Base'; | |||||||||
| 12 | |||||||||||
| 13 | 2 | with 'Games::AssaultCube::Log::Line::Base::TeamInfo'; | |||||||||
| 14 | |||||||||||
| 15 | # TODO improve validation for everything here, ha! | ||||||||||
| 16 | |||||||||||
| 17 | 2 | has 'players' => ( | |||||||||
| 18 | isa => 'Int', | ||||||||||
| 19 | is => 'ro', | ||||||||||
| 20 | required => 1, | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | 2 | has 'frags' => ( | |||||||||
| 24 | isa => 'Int', | ||||||||||
| 25 | is => 'ro', | ||||||||||
| 26 | required => 1, | ||||||||||
| 27 | ); | ||||||||||
| 28 | |||||||||||
| 29 | 2 | has 'flags' => ( | |||||||||
| 30 | isa => 'Int', | ||||||||||
| 31 | is => 'ro', | ||||||||||
| 32 | ); | ||||||||||
| 33 | |||||||||||
| 34 | has 'tostr' => ( | ||||||||||
| 35 | isa => 'Str', | ||||||||||
| 36 | is => 'ro', | ||||||||||
| 37 | lazy => 1, | ||||||||||
| 38 | 0 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 39 | 0 | my $self = shift; | |||||||||
| 40 | 0 | ▶ | return "Team Status for " . $self->team_name . ": " . $self->players . " players, " . $self->frags . " frags" . ( defined $self->flags ? ", " . $self->flags . " flags" : "" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | }, | ||||||||||
| 42 | 2 | ); | |||||||||
| 43 | |||||||||||
| 44 | 2 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 45 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||
| 46 | |||||||||||
| 47 | 2 | 1; | |||||||||
| 48 | __END__ | ||||||||||