| Games-Pandemic documentation | view source | Contained in the Games-Pandemic distribution. |
Games::Pandemic::Player - pandemic game player
version 1.111030
use Games::Pandemic::Player;
my $role = 'Games::Pandemic::Role::Medic';
my $player = Games::Pandemic::Player->new_with_traits(traits=>[$role]);
This is a class implementing a player.
Among other things, a player has a role. In fact, it is consuming one of
the Games::Pandemic::Role::* roles, which is applied as a trait
during object construction.
Therefore, to create a player, use the new_with_traits() method (as
is done in the synopsis section).
Return the $color (html notation) to be used for this player.
Return the (localized) name of $player's role.
Return true if the $player applies automatically a cure by just being
in the city.
Return true if the $player can build a research station in a city
even if she doesn't have the city card.
Return true if the $player can move till a city where there's
another player.
Return true if the $player can move the other's pawns during her
turn.
Return the number of cards of the same color that the $player needs
to find a cure for a disease.
Return true if the $player treats all the disease cubes in a city in
one go, even if the cure for the disease has not been discovered yet.
Return the maximum number of cards that a player can have in her hands.
Return the C$<path> to an image for the player role. $what can be either
icon or pawn. $size can be one of orig, or 32 or 16. Note that not
all combinations are possible.
Return the list of cards owned by $player. The list is sorted by type
of card, then by disease and by name.
Return the $card representing $city if the $player owns it,
undef otherwise.
$player gains a new $card.
Return true if $player can move, starting from her current location. Always
true. Included here for the sake of completeness.
Return true if $player can fly (regular flight) starting from her current
location. Flight is possible if the player has at least one city card, which is
not the card representing the city in which the player is.
Return true if $player can build a research station in her current
location. It is possible if she owns the card of the city, or if she is
the operation expert. Of course it is impossible if there's already a
station in the city.
Return the $disease that $player can cure, that is, if she owns
enough city cards of this disease and she is in a city with a research
station. Return undef otherwise.
Return true if $player can treat a disease. It is possible if her current
location is infected by one (or more) disease.
Return true if $player can pass. Always true. Included here for the sake of
completeness.
Return true if $player can drop a card. True if she has at least one card.
Return true if $player can travel to $city by proximity. This
means that $player is in a location next to $city.
Return true if $player can shuttle through research station to
$city. This means that both current player location and remote
$city have a research station. Of course, return value is false if
$player is currently located in <$city>.
Jerome Quelin
This software is Copyright (c) 2009 by Jerome Quelin.
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
| Games-Pandemic documentation | view source | Contained in the Games-Pandemic distribution. |