NAME

Games::Risk::Country - map country

VERSION

version 4.000

DESCRIPTION

This module implements a map country, with all its characteristics. The word country is a bit loose, since for some maps it can be either a region, a suburb... or a planet! :-)

ATTRIBUTES

name

The country name.

continent

A Games::Risk::Continent object in which the country is located.

greyval

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.

id

Alias for greyval.

coordx

The x location of the country capital.

coordy

The y location of the country capital.

connections

A list of country ids that can be accessed from the country. Note that it's not always reciprocical (connections can be one-way).

owner

A Games::Risk::Player object currently owning the country.

armies

Number of armies currently in the country.

METHODS

neighbours

my @neighbours = $country->neighbours;

Return the list of $country's neighbours (Games::Risk::Country objects).

is_neighbour

my $bool = $country->is_neighbour( $c );

Return true if $country is a neighbour of country $c, false otherwise.

AUTHOR

Jerome Quelin

COPYRIGHT AND LICENSE

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

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007