|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
10 #ifndef COMPANY_BASE_H
11 #define COMPANY_BASE_H
21 static const Money COMPANY_MAX_LOAN_DEFAULT = INT64_MIN;
141 return c !=
nullptr && c->
is_ai;
153 return c !=
nullptr && !c->
is_ai;
bool is_ai
If true, the company is (also) controlled by the computer (a NoAI program).
CompanyPool _company_pool
Pool of companies.
uint32_t clear_limit
Amount of tiles we can (still) clear (times 65536).
Money company_value
The value of the company.
@ ROADTYPE_END
Used for iterations.
static Titem * Get(size_t index)
Returns Titem with given index.
GroupStatistics group_all[VEH_COMPANY_END]
NOSAVE: Statistics for the ALL_GROUP group.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
RailTypes avail_railtypes
Rail types available to this company.
RoadTypes avail_roadtypes
Road types available to this company.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Tindex index
Index of this pool item.
byte money_fraction
Fraction of money of the company, too small to represent in money.
Class for storing amounts of cargo.
static void PostDestructor(size_t index)
Invalidating some stuff after removing item from the pool.
int16_t bankrupt_timeout
If bigger than 0, amount of time to wait for an answer on an offer to buy this company.
std::string name
Name of the company if the user changed it.
static bool IsValidHumanID(size_t index)
Is this company a valid company, not controlled by a NoAI program?
CompanyInfrastructure infrastructure
NOSAVE: Counts of company owned infrastructure.
uint32_t road[ROADTYPE_END]
Count of company owned track bits for each road type.
TileIndex last_build_coordinate
Coordinate of the last build thing by this company.
CompanyManagerFace face
Face description of the president.
uint32_t president_name_2
Parameter of president_name_1.
byte block_preview
Number of quarters that the company is not allowed to get new exclusive engine previews (see Companie...
Money CalculateCompanyValue(const Company *c, bool including_loan=true)
Calculate the value of the company.
RailTypes
Allow incrementing of Track variables.
Company(uint16_t name_1=0, bool is_ai=false)
Constructor.
Money current_loan
Amount of money borrowed from the bank.
uint32_t station
Count of company owned station tiles.
Statistics about the economy.
Statistics and caches on the vehicles in a group.
RailType
Enumeration for all possible railtypes.
uint32_t tree_limit
Amount of trees we can (still) plant (times 65536).
uint32_t GetRailTotal() const
Get total sum of all owned track bits.
byte num_valid_stat_ent
Number of valid statistical entries in old_economy.
@ VEH_COMPANY_END
Last company-ownable type.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
GroupStatistics group_default[VEH_COMPANY_END]
NOSAVE: Statistics for the DEFAULT_GROUP group.
byte months_of_bankruptcy
Number of months that the company is unable to pay its debts.
Colours colour
Company colour.
Money money
Money owned by the company.
CompanySettings settings
settings specific for each company
uint32_t name_2
Parameter of name_1.
static bool IsValidAiID(size_t index)
Is this company a valid company, controlled by the computer (a NoAI program)?
TileIndex location_of_HQ
Northern tile of HQ; INVALID_TILE when there is none.
uint32_t CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
std::string president_name
Name of the president if the user changed it.
static const uint MAX_HISTORY_QUARTERS
The maximum number of quarters kept as performance's history.
Money GetMaxLoan() const
Calculate the max allowed loan for this company.
Struct to store engine replacements.
static bool IsHumanID(size_t index)
Is this company a 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
CompanyMask bankrupt_asked
which companies were asked about buying it?
CargoArray delivered_cargo
The amount of delivered cargo.
Money expenses
The amount of expenses.
TimerGameEconomy::Year inaugurated_year
Economy year of starting the company.
Settings that can be set per company.
int32_t performance_history
Company score (scale 0-1000)
Base class for all pools.
uint32_t GetTramTotal() const
Get total sum of all owned tram bits.
CompanyEconomyEntry cur_economy
Economic data of the company of this quarter.
uint32_t airport
Count of company owned airports.
uint32_t signal
Count of company owned signals.
std::array< Expenses, 3 > yearly_expenses
Expenses of the company for the last three years.
@ RAILTYPE_END
Used for iterations.
uint32_t terraform_limit
Amount of tileheights we can (still) terraform (times 65536).
uint32_t GetRoadTotal() const
Get total sum of all owned road bits.
Money income
The amount of income.
StringID president_name_1
Name of the president if the user did not change it.
All static information from an AI like name, version, etc.
uint32_t build_object_limit
Amount of tiles we can (still) build objects on (times 65536). Also applies to buying land.
Runtime information about an AI like a pointer to the squirrel vm and the current state.
EngineRenewList engine_renew_list
Engine renewals of this company.
Base class for all PoolItems.
CompanyEconomyEntry old_economy[MAX_HISTORY_QUARTERS]
Economic data of the company of the last MAX_HISTORY_QUARTERS quarters.
Money CalculateHostileTakeoverValue(const Company *c)
Calculate what you have to pay to take over a company.
Information about a particular livery.
Statically loadable part of Company pool item.
uint32_t water
Count of company owned track bits for canals.
uint32_t rail[RAILTYPE_END]
Count of company owned track bits for each rail type.
StringID name_1
Name of the company if the user did not change it.
Money max_loan
Max allowed amount of the loan or COMPANY_MAX_LOAN_DEFAULT.
@ RAILTYPE_BEGIN
Used for iterations.