File Coverage

blib/lib/Games/AssaultCube/Log/Line/FlagScoredKTF.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::FlagScoredKTF;
3              
4             # import the Moose stuff
5 1     1   2879 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::FlagStole';
12              
13             # TODO improve validation for everything here, ha!
14              
15             has 'carried' => (
16             isa => 'Int',
17             is => 'ro',
18             required => 1,
19             );
20              
21             has 'score' => (
22             isa => 'Int',
23             is => 'ro',
24             required => 1,
25             );
26              
27             has 'tostr' => (
28             isa => 'Str',
29             is => 'ro',
30             lazy => 1,
31             default => sub {
32             my $self = shift;
33             return $self->nick . " scored the flag in KTF, carried it for " . $self->carried . " for a score of " . $self->score;
34             },
35             );
36              
37             no Moose;
38             __PACKAGE__->meta->make_immutable;
39              
40             1;
41             __END__
42              
43             =for stopwords KTF ip
44              
45             =head1 NAME
46              
47             Games::AssaultCube::Log::Line::FlagScoredKTF - Describes the FlagScoredKTF event in a log line
48              
49             =head1 ABSTRACT
50              
51             Describes the FlagScoredKTF event in a log line
52              
53             =head1 DESCRIPTION
54              
55             This module holds the "FlagScoredKTF" event data from a log line. Normally, you would not use this class directly
56             but via the L<Games::AssaultCube::Log::Line> class.
57              
58             This line is emitted when a client scores a flag in KTF ( Keep The Flag ) mode.
59              
60             =head2 Attributes
61              
62             Those attributes hold information about the event. As this class extends the L<Games::AssaultCube::Log::Line::Base>
63             class, you can also use it's attributes too.
64              
65             =head3 nick
66              
67             The nick of the client who scored the flag
68              
69             =head3 ip
70              
71             The ip of the client
72              
73             =head3 carried
74              
75             How long ( in seconds ) the client carried the flag
76              
77             =head3 score
78              
79             The new score for the client
80              
81             =head1 AUTHOR
82              
83             Apocalypse E<lt>apocal@cpan.orgE<gt>
84              
85             Props goes to the BS clan for the support!
86              
87             This project is sponsored by L<http://cubestats.net>
88              
89             =head1 COPYRIGHT AND LICENSE
90              
91             Copyright 2009 by Apocalypse
92              
93             This library is free software; you can redistribute it and/or modify
94             it under the same terms as Perl itself.
95              
96             =cut