| Games-AssaultCube documentation | Contained in the Games-AssaultCube distribution. |
Games::AssaultCube::Log::Line::Base::MasterMode - The MasterMode role for subclasses
This module provides the MasterMode role for subclasses.
This module provides the MasterMode role for subclasses. This is the AssaultCube server status.
Those attributes are part of the role, and will be applied to subclasses that use this.
The numeric AssaultCube mastermode of the server
0 = OPEN 1 = PRIVATE ( passworded ) 2 = NUM ( full )
The name of the mastermode on the server ( OPEN, PRIVATE, NUM )
Apocalypse <apocal@cpan.org>
Props goes to the BS clan for the support!
This project is sponsored by http://cubestats.net
Copyright 2009 by Apocalypse
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Games-AssaultCube documentation | Contained in the Games-AssaultCube distribution. |
# the mastermode role package Games::AssaultCube::Log::Line::Base::MasterMode; use Moose::Role; # Initialize our version use vars qw( $VERSION ); $VERSION = '0.04'; use Games::AssaultCube::Utils qw( get_mastermode_from_name get_mastermode_name ); has 'mastermode' => ( isa => 'Int', is => 'ro', lazy => 1, default => sub { my $self = shift; return get_mastermode_from_name( $self->mastermode_name ); }, ); has 'mastermode_name' => ( isa => 'Str', is => 'ro', lazy => 1, default => sub { my $self = shift; return get_mastermode_name( $self->mastermode ); }, ); sub BUILD { my $self = shift; # check role if ( ! exists $self->{'mastermode'} and ! exists $self->{'mastermode_name'} ) { die "Mastermode information is missing"; } return; } 1; __END__