Name

Cosair::AI::OwnNation - Cosair AI Class for an Own Planet


Synopsis

This class provides specific access to own planet information in the game and an interface for planet specific actions. It is a subclass of Cosair::AI::Planet.


Description

Planet State Information Methods

mines()

Returns the number of mines that protect the planet.

has_unrest()

Returns a boolean value indicating whether there is currently unrest reigning on the planet or not.

is_sabotaged()

Returns a boolean value indicating whether the production of the planet is currently sabotaged or not.

Population Related Methods

population()

Returns the current population in thousands (k) of this planet.

millions()

Returns the number of full units of million population.

max_population()

Returns the current maximum possible population in thousands (k) on this planet.

is_full()

Returns a boolean value indicating whether the planet is fully filled with population or not.

growth()

Returns the amount of population in k the planet will grow next turn.

Building Related Methods

buildings()

Returns the list of buildings the planet possesses. The return value is an array of item keywords limited to buildings. The item keywords are listed in the Cosair Bot Programming Manual.

has_building($)

Returns a boolean value indicating whether the planet has the given building or not. The only parameter is the item keyword to be checked for. The item keywords are listed in the Cosair Bot Programming Manual.

Production Related Methods

production()

Returns the production points the planet will produce next turn for the current item or for tradegoods.

current_item()

Returns the item keyword of the item currently being built, or undef if the planet is building trade goods.

production_points()

Returns the number of production points already finished for the current item.

item_cost($)

Returns the cost in production points a given item would cost on the planet, independently from the fact if the item can be actually built or not. The only parameter is the item keyword of the item to check for. The item keywords are listed in the CoSAIR Bot Programming manual.

item_duration($)

Returns the duration in turns the planet will need to build a given item, independently from the fact if the item can be actually built or not. The only parameter is the item keyword of the item to check for. The item keywords are listed in the CoSAIR Bot Programming manual.

trade_goods()

Returns the amount of gold the planet will generate next turn by producing trade goods.

is_rushing()

Retruns a boolean value indicating whether a planet has production rush currently activated or not.

rushing_cost()

Returns the amount of gold the owning nation will actually spend for rushing the production on this planet next turn.

activate_rush()

Activate production rush on this planet if currently deactivated.

deactivate_rush()

Deactivate production rush on this planet if currently activated.

Production Queue Related Methods

queue_items()

Returns the list of items in the planets production queue. The return value is a list of item keywords in the correct queue order. The first item in the queue is currently being built. The item keywords are listed in the Cosair Bot Programming Manual.

queue_contains($)

Returns an integer value indicating the number of times a given item is in the planets production queue. The only parameter is the item keyword to be checked for. The item keywords are listed in the Cosair Bot Programming Manual.

queue_cost()

Returns the number of production points needed to finish all items currently contained in the queue. Returns 0 if there are no items in the queue.

queue_duration()

Returns the number of turns needed to finish all items currently contained in the queue, regardless of whether the production is currently sabotaged or not.

possible_items()

Returns the list of items that can be built on the planet. The return value is an array of item keywords. The item keywords are listed in the Cosair Bot Programming Manual.

can_build($)

Returns a boolean value indicating whether a given item can be currently built on this planet or not. The only paramter is the item keyword to be checked for. The item keywords are listed in the Cosair Bot Programming Manual.

enqueue(@)

Add items to the planets production queue. You can pass this method a list of item keywords. The item keywords are listed in the Cosair Bot Programming Manual.

delete_queue()

Delete all items in the planet production queue. The item currently being built cannot be deleted.

Colonisation Related Methods

has_colonyship()

Returns a boolean value indicating whether the planet has a colonyship ready.

can_start_colonisation()

Returns a boolean value indicating whether the planet can start a new colonisation or not.

start_colonisation($)

Start a colonisation from this planet. The only parameter is the number of cruisers to send as escort with the colonisation.

Fleet Related Methods

stationed_fleet()

Returns the fleet stationed on this planet. The return value is a Cosair::AI::Fleet object or the undef value if no fleet is stationed on the planet.

stationed_cruisers()

Returns the number of cruisers stationed on this planet.

stationed_transports()

Returns the number of transports stationed on this planet.

arriving_fleets()

Returns a list of all own fleets on their way to this planet. The return value is an array of Cosair::AI::Fleet objects.

arriving_cruisers()

Returns the total number of cruisers in own fleets currently moving to this planet.

arriving_transports()

Returns the total number of transports in own fleets currently moving to this planet.