Class that handles all company related functions. More...
Public Types | |
enum | CompanyID { COMPANY_FIRST = 0, COMPANY_LAST = ::MAX_COMPANIES, COMPANY_SELF = 254, COMPANY_INVALID = -1 } |
Different constants related to CompanyID. More... | |
enum | Gender { GENDER_MALE, GENDER_FEMALE, GENDER_INVALID = -1 } |
Possible genders for company presidents. More... | |
Static Public Member Functions | |
static CompanyID | ResolveCompanyID (CompanyID company) |
Resolved the given company index to the correct index for the company. | |
static bool | IsMine (CompanyID company) |
Check if a CompanyID is your CompanyID, to ease up checks. | |
static bool | SetName (const char *name) |
Set the name of your company. | |
static char * | GetName (CompanyID company) |
Get the name of the given company. | |
static bool | SetPresidentName (const char *name) |
Set the name of your president. | |
static char * | GetPresidentName (CompanyID company) |
Get the name of the president of the given company. | |
static bool | SetPresidentGender (Gender gender) |
Set the gender of the president of your company. | |
static Gender | GetPresidentGender (CompanyID company) |
Get the gender of the president of the given company. | |
static bool | SetLoanAmount (int32 loan) |
Sets the amount to loan. | |
static bool | SetMinimumLoanAmount (int32 loan) |
Sets the minimum amount to loan, i.e. | |
static Money | GetLoanAmount () |
Gets the amount your company have loaned. | |
static Money | GetMaxLoanAmount () |
Gets the maximum amount your company can loan. | |
static Money | GetLoanInterval () |
Gets the interval/loan step. | |
static Money | GetCompanyValue (CompanyID company) |
Gets the current value of the given company. | |
static Money | GetBankBalance (CompanyID company) |
Gets the bank balance. | |
static bool | BuildCompanyHQ (TileIndex tile) |
Build your company's HQ on the given tile. | |
static TileIndex | GetCompanyHQ (CompanyID company) |
Return the location of a company's HQ. | |
static bool | SetAutoRenewStatus (bool autorenew) |
Set whether autorenew is enabled for your company. | |
static bool | GetAutoRenewStatus (CompanyID company) |
Return whether autorenew is enabled for a company. | |
static bool | SetAutoRenewMonths (int16 months) |
Set the number of months before/after max age to autorenew an engine for your company. | |
static int16 | GetAutoRenewMonths (CompanyID company) |
Return the number of months before/after max age to autorenew an engine for a company. | |
static bool | SetAutoRenewMoney (uint32 money) |
Set the minimum money needed to autorenew an engine for your company. | |
static uint32 | GetAutoRenewMoney (CompanyID company) |
Return the minimum money needed to autorenew an engine for a company. |
Class that handles all company related functions.
enum AICompany::CompanyID |
enum AICompany::Gender |
static bool AICompany::BuildCompanyHQ | ( | TileIndex | tile | ) | [static] |
Build your company's HQ on the given tile.
tile | The tile to build your HQ on, this tile is the most nothern tile of your HQ. |
static uint32 AICompany::GetAutoRenewMoney | ( | CompanyID | company | ) | [static] |
Return the minimum money needed to autorenew an engine for a company.
company | The company to get the autorenew money of. |
static int16 AICompany::GetAutoRenewMonths | ( | CompanyID | company | ) | [static] |
Return the number of months before/after max age to autorenew an engine for a company.
company | The company to get the autorenew months of. |
static bool AICompany::GetAutoRenewStatus | ( | CompanyID | company | ) | [static] |
Return whether autorenew is enabled for a company.
company | The company to get the autorenew status of. |
Gets the bank balance.
In other words, the amount of money the given company can spent.
company | The company to get the bank balance of. |
Return the location of a company's HQ.
company | The company the get the HQ of. |
Gets the current value of the given company.
company | The company to get the company value of. |
static Money AICompany::GetLoanAmount | ( | ) | [static] |
Gets the amount your company have loaned.
static Money AICompany::GetLoanInterval | ( | ) | [static] |
Gets the interval/loan step.
static Money AICompany::GetMaxLoanAmount | ( | ) | [static] |
Gets the maximum amount your company can loan.
static char* AICompany::GetName | ( | CompanyID | company | ) | [static] |
Get the name of the given company.
company | The company to get the name for. |
Get the gender of the president of the given company.
company | The company to get the presidents gender off. |
static char* AICompany::GetPresidentName | ( | CompanyID | company | ) | [static] |
Get the name of the president of the given company.
company | The company to get the president's name for. |
static bool AICompany::IsMine | ( | CompanyID | company | ) | [static] |
Check if a CompanyID is your CompanyID, to ease up checks.
company | The company index to check. |
Resolved the given company index to the correct index for the company.
If the company index was COMPANY_SELF it will be resolved to the index of your company. If the company with the given index does not exist it will return COMPANY_INVALID.
company | The company index to resolve. |
static bool AICompany::SetAutoRenewMoney | ( | uint32 | money | ) | [static] |
Set the minimum money needed to autorenew an engine for your company.
money | The new minimum required money for autorenew to work. |
static bool AICompany::SetAutoRenewMonths | ( | int16 | months | ) | [static] |
Set the number of months before/after max age to autorenew an engine for your company.
months | The new months between autorenew. |
static bool AICompany::SetAutoRenewStatus | ( | bool | autorenew | ) | [static] |
Set whether autorenew is enabled for your company.
autorenew | The new autorenew status. |
static bool AICompany::SetLoanAmount | ( | int32 | loan | ) | [static] |
Sets the amount to loan.
loan | The amount to loan (multiplier of GetLoanInterval()). |
static bool AICompany::SetMinimumLoanAmount | ( | int32 | loan | ) | [static] |
Sets the minimum amount to loan, i.e.
the given amount of loan rounded up.
loan | The amount to loan (any positive number). |
static bool AICompany::SetName | ( | const char * | name | ) | [static] |
Set the name of your company.
name | The new name of the company. |
AIError::ERR_NAME_IS_NOT_UNIQUE |
static bool AICompany::SetPresidentGender | ( | Gender | gender | ) | [static] |
Set the gender of the president of your company.
gender | The new gender for your president. |
static bool AICompany::SetPresidentName | ( | const char * | name | ) | [static] |
Set the name of your president.
name | The new name of the president. |
AIError::ERR_NAME_IS_NOT_UNIQUE |