File Coverage

blib/lib/Games/AssaultCube/Log/Line/MapError.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::MapError;
3              
4             # import the Moose stuff
5 1     1   2567 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             with 'Games::AssaultCube::Log::Line::Base::GameMode';
14              
15             # TODO improve validation for everything here, ha!
16              
17             has 'map' => (
18             isa => 'Str',
19             is => 'ro',
20             required => 1,
21             );
22              
23             has 'error' => (
24             isa => 'Str',
25             is => 'ro',
26             required => 1,
27             );
28              
29             has 'tostr' => (
30             isa => 'Str',
31             is => 'ro',
32             lazy => 1,
33             default => sub {
34             my $self = shift;
35             return "Error loading map " . $self->map . ": " . $self->error;
36             },
37             );
38              
39             no Moose;
40             __PACKAGE__->meta->make_immutable;
41              
42             1;
43             __END__
44              
45             =for stopwords CTF TDM gamemode
46             =head1 NAME
47              
48             Games::AssaultCube::Log::Line::MapError - Describes the MapError event in a log line
49              
50             =head1 ABSTRACT
51              
52             Describes the MapError event in a log line
53              
54             =head1 DESCRIPTION
55              
56             This module holds the "MapError" event data from a log line. Normally, you would not use this class directly
57             but via the L<Games::AssaultCube::Log::Line> class.
58              
59             This line is emitted when the AC server has an error with a map.
60              
61             =head2 Attributes
62              
63             Those attributes hold information about the event. As this class extends the L<Games::AssaultCube::Log::Line::Base>
64             class, you can also use it's attributes too.
65              
66             =head3 map
67              
68             The map name with the error
69              
70             =head3 gamemode
71              
72             The numeric AssaultCube gamemode ( look at L<Games::AssaultCube::Utils> for more info )
73              
74             P.S. It's better to use the gamemode_fullname or gamemode_name accessors
75              
76             =head3 gamemode_name
77              
78             The gamemode name ( CTF, TDM, etc )
79              
80             =head3 gamemode_fullname
81              
82             The full gamemode name ( "capture the flag", "team one shot one kill", etc )
83              
84             =head3 error
85              
86             The map error string
87              
88             =head1 AUTHOR
89              
90             Apocalypse E<lt>apocal@cpan.orgE<gt>
91              
92             Props goes to the BS clan for the support!
93              
94             This project is sponsored by L<http://cubestats.net>
95              
96             =head1 COPYRIGHT AND LICENSE
97              
98             Copyright 2009 by Apocalypse
99              
100             This library is free software; you can redistribute it and/or modify
101             it under the same terms as Perl itself.
102              
103             =cut