
Games::Risk::Map::Country - map country

my $country = Games::Risk::Map::Country->new(\%params);

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

Create a new country. Mandatory params are name, continent, greyval, x and y (see below in Accessors section for a quick definition of those params). Other attributes are optional, but can be supplied anyway.
The following accessors (acting as mutators, ie getters and setters) are available for Games::Risk::Map::Country objects:
number of armies currently in the country.
a Games::Risk::Map::Continent object in which the country is located.
an integer between 1 and 254 corresponding at the grey (all RGB values set to greyval()) used to draw the country on the grey-scale map.
alias for greyval().
country name.
a Games::Risk::Player object currently owning the country.
the x location of the country capital.
the y location of the country capital.
Change the owner of the $country to be $player. This implies updating cross-reference for previous owner and new one.
Remove all circular references of $country, to prevent memory leaks.
Return true if $country is a neighbour of country $c, false otherwise.
Return the list of $country's neighbours.
Add $c to the list of $country's neighbours. This is not reciprocical.


Jerome Quelin, <jquelin at cpan.org>

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+.