Name

Cosair::AI::Control - Cosair AI Control Class


Synopsis

This class provides access to all game state information and game objects.


Description

Game Information Methods

game_turn()

Returns the number of the current turn.

game_map_dimension()

Returns the map dimension of the game.

game_num_players()

Returns the number of players in the game.

game_rule($)

Returns the value of a given rule. The only parameter is one of the following rule keywords:

events()

Returns a list of all events that happened in the game. The list is an array of hash references containing the individual events. The hash keys contain the relevant information and are described below.

current_events()

Returns a list of all events that happened at the beginning of the current turn. The list is an array of hash references containing the individual events as described above.

Nation Methods

own_nation()

Returns the own nation. The return value is a reference to a Cosair::AI::OwnNation object.

nations()

Returns a list of all nations in the game, including exterminated ones. The return value is an array of Cosair::AI::Nation objects, which are indeed either Cosair::AI::OwnNation or Cosair::AI::NmeNation objects.

active_nations()

Returns a list of all active nations in the game. The return value is an array of Cosair::AI::Nation objects.

active_nme_nations()

Returns a list of all active enemy nations in the game. The return value is an array of Cosair::AI::NmeNation objects.

nation($)

Returns a nation by a given id. The only parameter is the integer id of the nation. The return value is a reference to a Cosair::AI::Nation object, which is indeed either a Cosair::AI::OwnNation or a Cosair::AI::NmeNation object.

Planet Methods

planets()

Returns a list of all planets in the game. The return value is an array of Cosair::AI::Planet objects, which are indeed either Cosair::AI::OwnPlanet or Cosair::AI::NmePlanet objects.

nme_planets()

Returns a list of all enemy planets. The return value is an array of Cosair::AI::NmePlanet objects.

planet($)

Returns a planet by a given id. The only parameter is the integer id of the planet. The return value is a reference to a Cosair::AI::Planet object, which is indeed either a Cosair::AI::OwnPlanet or a Cosair::AI::NmePlanet object.

Statistical Methods

attacks()

Returns a list of all attack events that happened in the game.