File Coverage

blib/lib/Games/AssaultCube/Log/Line/LoadedMap.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             # Declare our package
2             package Games::AssaultCube::Log::Line::LoadedMap;
3              
4             # import the Moose stuff
5 1     1   2340 use Moose;
  0            
  0            
6              
7             # Initialize our version
8             use vars qw( $VERSION );
9             $VERSION = '0.04';
10              
11             extends 'Games::AssaultCube::Log::Line::Base';
12              
13             # TODO improve validation for everything here, ha!
14              
15             has 'map' => (
16             isa => 'Str',
17             is => 'ro',
18             required => 1,
19             );
20              
21             has 'mapsize' => (
22             isa => 'Int',
23             is => 'ro',
24             required => 1,
25             );
26              
27             has 'cfgsize' => (
28             isa => 'Int',
29             is => 'ro',
30             required => 1,
31             );
32              
33             has 'cfgzsize' => (
34             isa => 'Int',
35             is => 'ro',
36             required => 1,
37             );
38              
39             has 'tostr' => (
40             isa => 'Str',
41             is => 'ro',
42             lazy => 1,
43             default => sub {
44             my $self = shift;
45             return "Loaded map " . $self->map . " (" . $self->mapsize . " bytes)";
46             },
47             );
48              
49             no Moose;
50             __PACKAGE__->meta->make_immutable;
51              
52             1;
53             __END__
54              
55             =for stopwords cfg cfgsize cfgzsize mapsize
56             =head1 NAME
57              
58             Games::AssaultCube::Log::Line::LoadedMap - Describes the LoadedMap event in a log line
59              
60             =head1 ABSTRACT
61              
62             Describes the LoadedMap event in a log line
63              
64             =head1 DESCRIPTION
65              
66             This module holds the "LoadedMap" event data from a log line. Normally, you would not use this class directly
67             but via the L<Games::AssaultCube::Log::Line> class.
68              
69             This line is emitted when the AC server successfully loads a map.
70              
71             =head2 Attributes
72              
73             Those attributes hold information about the event. As this class extends the L<Games::AssaultCube::Log::Line::Base>
74             class, you can also use it's attributes too.
75              
76             =head3 map
77              
78             The name of the map loaded
79              
80             =head3 mapsize
81              
82             The size of the map ( in bytes )
83              
84             =head3 cfgsize
85              
86             The size of the cfg file ( in bytes )
87              
88             =head3 cfgzsize
89              
90             The size of the cfg file - gzipped ( in bytes )
91              
92             =head1 AUTHOR
93              
94             Apocalypse E<lt>apocal@cpan.orgE<gt>
95              
96             Props goes to the BS clan for the support!
97              
98             This project is sponsored by L<http://cubestats.net>
99              
100             =head1 COPYRIGHT AND LICENSE
101              
102             Copyright 2009 by Apocalypse
103              
104             This library is free software; you can redistribute it and/or modify
105             it under the same terms as Perl itself.
106              
107             =cut