« Games/AssaultCube/MasterserverQuery/Response.pm
↑ Summary
Games/AssaultCube/Log/Line/Base/GameMode.pm »
| 1 | # Declare our package | ||||||||||
| 2 | package Games::AssaultCube::Log::Line::ClientStatus; | ||||||||||
| 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 | 'Games::AssaultCube::Log::Line::Base::RoleInfo', | ||||||||||
| 15 | 'Games::AssaultCube::Log::Line::Base::NickIP'; | ||||||||||
| 16 | |||||||||||
| 17 | # TODO improve validation for everything here, ha! | ||||||||||
| 18 | |||||||||||
| 19 | 2 | has 'cn' => ( | |||||||||
| 20 | isa => 'Int', | ||||||||||
| 21 | is => 'ro', | ||||||||||
| 22 | required => 1, | ||||||||||
| 23 | ); | ||||||||||
| 24 | |||||||||||
| 25 | 2 | has 'frags' => ( | |||||||||
| 26 | isa => 'Int', | ||||||||||
| 27 | is => 'ro', | ||||||||||
| 28 | required => 1, | ||||||||||
| 29 | ); | ||||||||||
| 30 | |||||||||||
| 31 | 2 | has 'deaths' => ( | |||||||||
| 32 | isa => 'Int', | ||||||||||
| 33 | is => 'ro', | ||||||||||
| 34 | required => 1, | ||||||||||
| 35 | ); | ||||||||||
| 36 | |||||||||||
| 37 | 2 | has 'flags' => ( | |||||||||
| 38 | isa => 'Int', | ||||||||||
| 39 | is => 'ro', | ||||||||||
| 40 | ); | ||||||||||
| 41 | |||||||||||
| 42 | has 'tostr' => ( | ||||||||||
| 43 | isa => 'Str', | ||||||||||
| 44 | is => 'ro', | ||||||||||
| 45 | lazy => 1, | ||||||||||
| 46 | 0 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 47 | 0 | my $self = shift; | |||||||||
| 48 | |||||||||||
| 49 | # we want nicely-formatted output | ||||||||||
| 50 | 0 | ▶ | return sprintf( "Client status of %25s (%4s): %3d frags, %3d deaths%s", $self->nick, $self->team_name, $self->frags, $self->deaths, ( defined $self->flags ? sprintf( ", %d flags", $self->flags ) : "" ) ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | }, | ||||||||||
| 52 | 2 | ); | |||||||||
| 53 | |||||||||||
| 54 | # TODO Moose can't export multiple roles into this class unless it defines BUILD... | ||||||||||
| 55 | # Error: 'Games::AssaultCube::Log::Line::Base::Mastermode|Games::AssaultCube::Log::Line::Base::Gamemode' requires the method 'BUILD' to be implemented by 'Games::AssaultCube::Log::Line::GameStatus' at /usr/local/share/perl/5.10.0/Moose/Meta/Role/Application.pm line 59 | ||||||||||
| 56 | 5 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 57 | 5 | return; | |||||||||
| 58 | } | ||||||||||
| 59 | |||||||||||
| 60 | 2 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 61 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||
| 62 | |||||||||||
| 63 | 2 | 1; | |||||||||
| 64 | __END__ | ||||||||||