NAME
Games::Risk::Map::Country - map country
SYNOPSIS
my $id = Games::Risk::Map::Country->new(\%params);
DESCRIPTION
This module implements a map country, with all its characteristics.
METHODS
Constructor
my $player = Games::Risk::Map::Country->new( \%params )
Create a new country. Mandatory params are
name
,continent
,greyval
,x
andy
(see below inAccessors
section for a quick definition of those params). Other attributes are optional, but can be supplied anyway.
Accessors
The following accessors (acting as mutators, ie getters and setters) are available for Games::Risk::Map::Country
objects:
armies()
number of armies currently in the country.
continent()
a
Games::Risk::Map::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()
.name()
country name.
owner()
a
Games::Risk::Player
object currently owning the country.x()
the x location of the country capital.
y()
the y location of the country capital.
Methods
$country->chown( $player )
Change the owner of the
$country
to be$player
. This implies updating cross-reference for previous owner and new one.my $bool = $country->is_neighbour( $id )
Return true if $country is a neighbour of country with id $id, false otherwise.
SEE ALSO
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+.