WormAIDev  Worm SELF_VERSION
 All Classes Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
WormAI Class Reference

Define the main class of our AI WormAI. More...

Public Member Functions

function GetAuthor ()
function GetName ()
function GetShortName ()
function GetDescription ()
function GetVersion ()
function GetDate ()
function MinVersionToLoad ()
function CreateInstance ()
function GetAPIVersion ()
function GetURL ()
function GetSettings ()
constructor WormAI ()
 Create an instance of WormAI.
Implementation of base class functions
function Start ()
 Start the main loop of WormAI.
function Save ()
 Save all data that WormAI uses.
function Load (version, data)
 Load previously saved information.
Initialization functions
function InitSettings ()
 InitSettings initializes a number of required variables based on the game settings of our AI.
function Welcome ()
 Welcome says hello to the user and prints out the current AI gamesettings.
function CanBuildAircraft ()
 Checks if we can build an aircraft and if not outputs a string with the reason.
function CanBuildTrains ()
 Checks if we can build trains and if not outputs a string with the reason.

Public Attributes

 name = null
 The name that we will give our AI.
 air_manager = null
 The Air Manager class.
 rail_manager = null
 The Rail Manager class.
 ai_speed_factor = 1
 speed factor for our ai actions (1=fast..3=slow)
 delay_build_airport_route = 0
 delay_build_rail_route = 0
 use_air = false
 Whether we can use aircraft or not.
 use_trains = false
 Whether we can use trains or not.
 loaded_from_save = false
 aircraft_disabled_shown = 0
 Has the aircraft disabled in game settings message been shown (1) or not (0).
 aircraft_max0_shown = 0
 Has the max aircraft is 0 in game settings message been shown.
 trains_disabled_shown = 0
 Has the trains disabled in game settings message been shown (1) or not (0).
 trains_max0_shown = 0
 Has the max trains is 0 in game settings message been shown.

Detailed Description

Define the main class of our AI WormAI.

Constructor & Destructor Documentation

constructor WormAI::WormAI ( )
inline

Create an instance of WormAI.

Member Function Documentation

function WormAI::CanBuildAircraft ( )

Checks if we can build an aircraft and if not outputs a string with the reason.

Returns
true if we can build an aircraft, otherwise false.
function WormAI::CanBuildTrains ( )

Checks if we can build trains and if not outputs a string with the reason.

Returns
true if we can build trains, otherwise false.
function WormAI::Load ( version  ,
data   
)

Load previously saved information.

Parameters
versionWhich version of our AI saved the information.
dataThe data that was saved.
Todo:
load data in temp values then later unpack it because load has limited time available
Todo:
This should call air_manager.LoadData for air related SaveGame data.
function WormAI::Save ( )

Save all data that WormAI uses.

Returns
The data to be saved.
Todo:
This should be moved to a AirManager.SaveData function.

The documentation for this class was generated from the following files: