Go to the documentation of this file.
10 #ifndef COMPANY_BASE_H
11 #define COMPANY_BASE_H
136 return c !=
nullptr && c->
is_ai;
148 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 TileIndex
The index/ID of a Tile.
Money company_value
The value of the company.
static Titem * Get(size_t index)
Returns Titem with given index.
@ EXPENSES_END
Number of expense types.
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.
uint32 CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
RoadTypes avail_roadtypes
Road types available to this company.
Year inaugurated_year
Year of starting the company.
uint32 tree_limit
Amount of trees we can (still) plant (times 65536).
uint32 water
Count of company owned track bits for canals.
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.
uint32 station
Count of company owned station tiles.
int32 Year
Type for the year, note: 0 based, i.e. starts at the year 0.
@ ROADTYPE_END
Used for iterations.
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.
TileIndex last_build_coordinate
Coordinate of the last build thing by this company.
CompanyManagerFace face
Face description of the president.
byte block_preview
Number of quarters that the company is not allowed to get new exclusive engine previews (see Companie...
Owner
Enum for all companies/owners.
Money CalculateCompanyValue(const Company *c, bool including_loan=true)
Calculate the value of the company.
Money current_loan
Amount of money borrowed from the bank.
Statistics about the economy.
uint32 GetRoadTotal() const
Get total sum of all owned road bits.
uint32 name_2
Parameter of name_1.
uint32 clear_limit
Amount of tiles we can (still) clear (times 65536).
Statistics and caches on the vehicles in a group.
uint32 GetTramTotal() const
Get total sum of all owned tram bits.
Company(uint16 name_1=0, bool is_ai=false)
Constructor.
byte colour
Company colour.
RailType
Enumeration for all possible railtypes.
int32 performance_history
Company score (scale 0-1000)
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.
@ VEH_COMPANY_END
Last company-ownable type.
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.
Money money
Money owned by the company.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
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.
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.
uint32 road[ROADTYPE_END]
Count of company owned track bits for each road type.
uint32 signal
Count of company owned signals.
Money yearly_expenses[3][EXPENSES_END]
Expenses of the company for the last three years, in every ExpensesType category.
EngineRenewList engine_renew_list
Engine renewals of this company.
Owner share_owners[4]
Owners of the 4 shares of the company. INVALID_OWNER if nobody has bought them yet.
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?
uint32 president_name_2
Parameter of president_name_1.
CargoArray delivered_cargo
The amount of delivered cargo.
uint _next_competitor_start
the number of ticks before the next AI is started
Money expenses
The amount of expenses.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Settings that can be set per company.
Base class for all pools.
CompanyEconomyEntry cur_economy
Economic data of the company of this quarter.
@ RAILTYPE_END
Used for iterations.
uint32 rail[RAILTYPE_END]
Count of company owned track bits for each rail type.
uint32 airport
Count of company owned airports.
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.
Runtime information about an AI like a pointer to the squirrel vm and the current state.
RailTypes
The different railtypes we support, but then a bitmask of them.
Base class for all PoolItems.
CompanyEconomyEntry old_economy[MAX_HISTORY_QUARTERS]
Economic data of the company of the last MAX_HISTORY_QUARTERS quarters.
int16 bankrupt_timeout
If bigger than 0, amount of time to wait for an answer on an offer to buy this company.
CompanySettings settings
settings specific for each company
Information about a particular livery.
Statically loadable part of Company pool item.
uint32 GetRailTotal() const
Get total sum of all owned track bits.
StringID name_1
Name of the company if the user did not change it.
@ RAILTYPE_BEGIN
Used for iterations.