Jerome Quelin > Games-Pandemic-1.120510 > Games::Pandemic::City

Download:
Games-Pandemic-1.120510.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.120510   Source  

NAME ^

Games::Pandemic::City - pandemic city object

VERSION ^

version 1.120510

DESCRIPTION ^

This module implements a class for city objects, used in Pandemic. They have different attributes:

METHODS ^

$city->build_station;

Create a research station in the city.

$city->quash_station;

Remove the research station that was in the city.

my $bool = $city->has_station;

Return true if the city has a research station.

my @cities = $city->neighbours;

Return a list of Games::Pandemic::City, which are the direct neighbours of $city.

my ($outbreak, $nbreal) = $city->infect( [ $nb [, $disease] ] )

Infect $city with $nb items of $disease. Return true if an outbreak happened following this infection, false otherwise. If an outbreak happened, return also the real number of items used (since a city can only hold up to a maximum number of disease items).

$nb defaults to 1, and $disease to the city disease.

my $nb = $city->get_infection( $disease );

Return the number of $disease items for the $city.

$city->treat( $disease, $nb );

Remove $nb items from $disease in $city.

AUTHOR ^

Jerome Quelin

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2009 by Jerome Quelin.

This is free software, licensed under:

  The GNU General Public License, Version 2, June 1991
syntax highlighting: