Games::Risk::Card - map card


Games-Risk documentation Contained in the Games-Risk distribution.

Index


Code Index:

NAME

Top

Games::Risk::Card - map card

VERSION

Top

version 3.103040

SYNOPSIS

Top

    my $card = Games::Risk::Card->new(\%params);

DESCRIPTION

Top

This module implements a map card, with all its characteristics.

METHODS

Top

Constructor

* my $card = Games::Risk::Card->new( \%params )

Create a new card. Mandatory param is type, and there's an optional param country.

Accessors

The following accessors (acting as mutators, ie getters and setters) are available for Games::Risk::Card objects:

* country()

country corresponding to the card.

* type()

the type of the card: artillery, cavalry, infantery or wildcard

Methods

* $card->destroy()

Remove all circular references of $card, to prevent memory leaks.

SEE ALSO

Top

Games::Risk.

AUTHOR

Top

  Jerome Quelin

COPYRIGHT AND LICENSE

Top


Games-Risk documentation Contained in the Games-Risk distribution.

#
# This file is part of Games-Risk
#
# This software is Copyright (c) 2008 by Jerome Quelin.
#
# This is free software, licensed under:
#
#   The GNU General Public License, Version 3, June 2007
#
use 5.010;
use strict;
use warnings;

package Games::Risk::Card;
BEGIN {
  $Games::Risk::Card::VERSION = '3.103040';
}
# ABSTRACT: map card

use base qw{ Class::Accessor::Fast };
__PACKAGE__->mk_accessors( qw{ country type } );


#--
# METHODS

# -- public methods

#
# $card->destroy;
#
# Remove all circular references of $card, to prevent memory leaks.
#
#sub DESTROY { say "destroy: $_[0]"; }
sub destroy {
    my ($self) = @_;
    $self->country(undef);
}




1;




__END__