12 #ifndef COMPANY_BASE_H 13 #define COMPANY_BASE_H 106 free(this->president_name);
111 Company(uint16 name_1 = 0,
bool is_ai =
false);
135 return c != NULL && c->
is_ai;
147 return c != NULL && !c->
is_ai;
162 static void PostDestructor(
size_t index);
165 #define FOR_ALL_COMPANIES_FROM(var, start) FOR_ALL_ITEMS_FROM(Company, company_index, var, start) 166 #define FOR_ALL_COMPANIES(var) FOR_ALL_COMPANIES_FROM(var, 0)
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
Enums and other types related to roads.
RailTypes
The different roadtypes we support, but then a bitmask of them.
char * name
Name of the company if the user changed it.
RailType
Enumeration for all possible railtypes.
Runtime information about an AI like a pointer to the squirrel vm and the current state...
static Titem * Get(size_t index)
Returns Titem with given index.
int32 performance_history
Company score (scale 0-1000)
byte money_fraction
Fraction of money of the company, too small to represent in money.
uint32 GetRailTotal() const
Get total sum of all owned track bits.
Year inaugurated_year
Year of starting the company.
EngineRenewList engine_renew_list
Engine renewals of this company.
Base class for groups and group functions.
Last company-ownable type.
byte block_preview
Number of quarters that the company is not allowed to get new exclusive engine previews (see Companie...
CompanyMask bankrupt_asked
which companies were asked about buying it?
CompanyPool _company_pool
Pool of companies.
static bool IsHumanID(size_t index)
Is this company a company not controlled by a NoAI program?
byte months_of_bankruptcy
Number of months that the company is unable to pay its debts.
char * president_name
Name of the president if the user changed it.
uint32 name_2
Parameter of name_1.
uint32 station
Count of company owned station tiles.
int32 Year
Type for the year, note: 0 based, i.e. starts at the year 0.
CompanySettings settings
settings specific for each company
static bool IsValidHumanID(size_t index)
Is this company a valid company, not controlled by a NoAI program?
uint _cur_company_tick_index
used to generate a name for one company that doesn't have a name yet per tick
Money expenses
The amount of expenses.
uint32 CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
uint32 signal
Count of company owned signals.
uint32 terraform_limit
Amount of tileheights we can (still) terraform (times 65536).
byte num_valid_stat_ent
Number of valid statistical entries in old_economy.
Statistics and caches on the vehicles in a group.
static bool IsValidAiID(size_t index)
Is this company a valid company, controlled by the computer (a NoAI program)?
Statically loadable part of Company pool item.
Money current_loan
Amount of money borrowed from the bank.
Types related to global configuration settings.
TileIndex location_of_HQ
Northern tile of HQ; INVALID_TILE when there is none.
uint32 clear_limit
Amount of tiles we can (still) clear (times 65536).
Information about a particular livery.
Money CalculateCompanyValue(const Company *c, bool including_loan=true)
Calculate the value of the company.
bool is_ai
If true, the company is (also) controlled by the computer (a NoAI program).
Money money
Money owned by the company.
uint32 airport
Count of company owned airports.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
CompanyManagerFace face
Face description of the president.
Base class for all PoolItems.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
int16 bankrupt_timeout
If bigger than 0, amount of time to wait for an answer on an offer to buy this company.
uint32 tree_limit
Amount of trees we can (still) plant (times 65536).
Base class for all pools.
uint32 president_name_2
Parameter of president_name_1.
CompanyInfrastructure infrastructure
NOSAVE: Counts of company owned infrastructure.
Functions/types related to livery colours.
Class for storing amounts of cargo.
static const uint MAX_HISTORY_QUARTERS
The maximum number of quarters kept as performance's history.
Types related to autoreplacing.
All static information from an AI like name, version, etc.
uint32 TileIndex
The index/ID of a Tile.
RailTypes avail_railtypes
Rail types available to the company.
StringID name_1
Name of the company if the user did not change it.
byte colour
Company colour.
CargoArray delivered_cargo
The amount of delivered cargo.
Settings that can be set per company.
StringID president_name_1
Name of the president if the user did not change it.
Struct to store engine replacements.
RoadTypes avail_roadtypes
Road types available to this company.
TileIndex last_build_coordinate
Coordinate of the last build thing by this company.
uint _next_competitor_start
the number of ticks before the next AI is started
static void free(const void *ptr)
Version of the standard free that accepts const pointers.
Statistics about the economy.
Money income
The amount of income.
Money company_value
The value of the company.
CompanyEconomyEntry cur_economy
Economic data of the company of this quarter.
uint32 water
Count of company owned track bits for canals.