Name

Cosair::AI::Nation - Cosair AI Nation Superclass


Synopsis

This class provides access to general nation information in the game. It is the superclass for Cosair::AI::OwnNation and Cosair::AI::NmeNation, which provide more specific information and action interfaces.


Description

Information Methods

id()

Returns the unique id number of the nation.

name()

Returns the name of the Nation.

status()

Returns the current status of this nation in the game. Possible return values are:

potential()

Returns the potential value of the nation.

planets()

Returns a list of all planets of the nation. The list is an array of Cosair::AI::Planet objects. These are either Cosair::AI::OwnPlanet or Cosair::AI::NmePlanet objects, depending on the type of nation you call this method upon.

colonised_planets()

Returns the list of planet id's that have been colonised by this nation.

last_conquest()

Returns the event object of the last conquest by the nation, or undef if there has been no conquest by this nation yet.

age_of_last_conquest()

Returns the age in turns since the last conquest by this nation, or undef if there has been no conquest by this nation yet.

Distance Related Methods

duration_for_distance($)

Returns the duration in turns the nation needs to pass the given distance with either fleets or agents.

distance_to_planet($)

Returns the distance from this nation to a given planet. The only parameter is the Cosair::AI::Planet object to calculate the distance to. The return value is a numerical value of the euclidian distance on the map, whereas 1 is the unit between 2 directly neighbored squares. If you pass an own planet or call this method on an exterminated nation, the undef value is returned.

distance_to_nation($)

Returns the distance from this nation to a given nation, i.e. the nearest planet of the nation. The only parameter is the Cosair::AI::Nation object to calculate the distance to. The return value is a numerical value of the euclidian distance on the map, whereas 1 is the unit between 2 directly neighbored squares. If you pass the calling nation itself or an exterminated one, the undef value is returned.

distance_to_nearest_nation()

Returns the distance from this nation to the nearest next one, i.e. the nearest planet of the nation. The return value is a numerical value of the euclidian distance on the map, whereas 1 is the unit between 2 directly neighbored squares.

nearest_planet_of_nation($)

Returns the nearest planet of a given nation to this nation. The only parameter is the Cosair::AI::Nation object to search the planet of. The return value is the Cosair::AI::Planet object of the nearest planet. If you pass the calling nation itself or an exterminated nation, the undef value is returned.

nme_planets_within_distance($)

Returns a list of enemy planets within a given distance from this nation. The only parameter is the distance value to decide upon. The return value is a list of Cosair::AI::Planet objects.

nme_nations_within_distance($)

Returns a list of enemy nations within a given distance from this nation. The only parameter is the distance value to decide upon. The return value is a list of Cosair::AI::Nation objects.

Statistical Methods

ranking()

Returns a fractional number indicating the relative potential with respect to the strongest enemy nation in the game. I.e. the number will be above 1.0 in case this nation is the strongest one and below 1.0 if it is not. The victory condition of the game corresponds to a 2.0 value.

planets_conquered()

Returns the events of successful attacks of this nation in the course of the game. See the API documentation of the class Cosair::AI::Control for a description of event entries.

planets_lost()

Returns the events of successful attacks against this nation in the course of the game. See the API documentation of the class Cosair::AI::Control for a description of event entries.