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

Define the WormMoney class containing money related functions. More...

Public Attributes

 WM_SILENT = true
 WM_SHOWINFO = false

Money related functions

static function HasMoney (money)
 Check if we have enough money (via loan and on bank).
static function GetMoney (money, silent=false)
 Get the amount of money requested, loan if needed.
static function InflationCorrection (money)
 Compute the amount of money corrected for inflation.
function GetMinimumCashNeeded ()
 Calculates the minimum amount of cash needed to be at hand.

Detailed Description

Define the WormMoney class containing money related functions.

Member Function Documentation

function WormMoney::GetMinimumCashNeeded ( )

Calculates the minimum amount of cash needed to be at hand.

This is used to avoid going bankrupt because of station maintenance costs.

Note
Taken from SimpleAI.
Todo:
Think of a better computation than stationcount * 50 since I think maintenance costs don't increase linearly.
Returns
10000 pounds plus the expected station maintenance costs.
Todo:
Maybe also use InflationCorrection on GetLoanInterval or is that already corrected for inflation?
function WormMoney::GetMoney ( money  ,
silent  = false 
)
static

Get the amount of money requested, loan if needed.

Parameters
moneyThe amount of money we need.
silent(false by default) Whether or not we should show info about failure to get money or getting a loan.
Returns
Boolean saying if we got the needed money or not.
function WormMoney::HasMoney ( money  )
static

Check if we have enough money (via loan and on bank).

Parameters
moneyThe amount of money we need.
Returns
Boolean saying if we do or don't have enough money.
function WormMoney::InflationCorrection ( money  )
static

Compute the amount of money corrected for inflation.

Parameters
moneyThe uncorrected amount of money.
Returns
The inflation corrected amount of money.
Note
Adapted from SuperLib.Money.Inflate: Computes GetInflationRate only once.

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