Jerome Quelin > Games-Risk-2.1.1 > Games::Risk::Player

Download:
Games-Risk-2.1.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

Games::Risk::Player - risk player

SYNOPSIS ^

    my $id = Games::Risk::Player->new(\%params);

DESCRIPTION ^

This module implements a risk player, with all its characteristics.

METHODS ^

Constructor

Accessors

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

Object methods

The following methods are available for Games::Risk::Player objects:

my @cards = $player->cards()

Return the list of cards (Games::Risk::Map::Card objects) currently owned by $player.

* $player->card_add( $card )

Add $card to the set of cards owned by $player.

* $player->card_del( $card )

Remove $card from the set of cards owned by player.

* my @countries = $player->countries()

Return the list of countries (Games::Risk::Map::Country objects) currently owned by $player.

* $player->country_add( $country )

Add $country to the set of countries owned by $player.

* $player->country_del( $country )

Delete $country from the set of countries owned by $player.

* $player->destroy()

Break all circular references in $player, to prevent memory leaks.

* my $greatness = $player->greatness()

Return an integer reflecting the greatness of $player. It will raise with the number of owned territories, as well as the number of armies.

SEE ALSO ^

Games::Risk.

AUTHOR ^

Jerome Quelin, <jquelin at cpan.org>

COPYRIGHT & LICENSE ^

Copyright (c) 2008 Jerome Quelin, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU GPLv3+.