OpenTTD Source 20241224-master-gf74b0cf984
CompanyProperties Struct Reference

Statically loadable part of Company pool item. More...

#include <company_base.h>

Inheritance diagram for CompanyProperties:
Company

Data Fields

uint32_t name_2
 Parameter of name_1.
 
StringID name_1
 Name of the company if the user did not change it.
 
std::string name
 Name of the company if the user changed it.
 
StringID president_name_1
 Name of the president if the user did not change it.
 
uint32_t president_name_2
 Parameter of president_name_1.
 
std::string president_name
 Name of the president if the user changed it.
 
NetworkAuthorizedKeys allow_list
 Public keys of clients that are allowed to join this company.
 
CompanyManagerFace face
 Face description of the president.
 
Money money
 Money owned by the company.
 
uint8_t money_fraction
 Fraction of money of the company, too small to represent in money.
 
Money current_loan
 Amount of money borrowed from the bank.
 
Money max_loan
 Max allowed amount of the loan or COMPANY_MAX_LOAN_DEFAULT.
 
Colours colour
 Company colour.
 
uint8_t block_preview
 Number of quarters that the company is not allowed to get new exclusive engine previews (see CompaniesGenStatistics).
 
TileIndex location_of_HQ
 Northern tile of HQ; INVALID_TILE when there is none.
 
TileIndex last_build_coordinate
 Coordinate of the last build thing by this company.
 
TimerGameEconomy::Year inaugurated_year
 Economy year of starting the company.
 
TimerGameCalendar::Year inaugurated_year_calendar
 Calendar year of starting the company. Used to display proper Inauguration year while in wallclock mode.
 
uint8_t months_empty = 0
 NOSAVE: Number of months this company has not had a client in multiplayer.
 
uint8_t months_of_bankruptcy
 Number of months that the company is unable to pay its debts.
 
CompanyMask bankrupt_asked
 which companies were asked about buying it?
 
int16_t bankrupt_timeout
 If bigger than 0, amount of time to wait for an answer on an offer to buy this company.
 
Money bankrupt_value
 
uint32_t terraform_limit
 Amount of tileheights we can (still) terraform (times 65536).
 
uint32_t clear_limit
 Amount of tiles we can (still) clear (times 65536).
 
uint32_t tree_limit
 Amount of trees we can (still) plant (times 65536).
 
uint32_t build_object_limit
 Amount of tiles we can (still) build objects on (times 65536). Also applies to buying land.
 
bool is_ai
 If true, the company is (also) controlled by the computer (a NoAI program).
 
std::array< Expenses, 3 > yearly_expenses {}
 Expenses of the company for the last three years.
 
CompanyEconomyEntry cur_economy
 Economic data of the company of this quarter.
 
CompanyEconomyEntry old_economy [MAX_HISTORY_QUARTERS]
 Economic data of the company of the last MAX_HISTORY_QUARTERS quarters.
 
uint8_t num_valid_stat_ent
 Number of valid statistical entries in old_economy.
 
Livery livery [LS_END]
 
EngineRenewList engine_renew_list
 Engine renewals of this company.
 
CompanySettings settings
 settings specific for each company
 

Detailed Description

Statically loadable part of Company pool item.

Definition at line 69 of file company_base.h.

Constructor & Destructor Documentation

◆ CompanyProperties()

CompanyProperties::CompanyProperties ( )
inline

Definition at line 125 of file company_base.h.

Field Documentation

◆ allow_list

NetworkAuthorizedKeys CompanyProperties::allow_list

Public keys of clients that are allowed to join this company.

Definition at line 78 of file company_base.h.

Referenced by NetworkClientInfo::CanJoinCompany(), and SlAllowListData::GetVector().

◆ bankrupt_asked

CompanyMask CompanyProperties::bankrupt_asked

which companies were asked about buying it?

Definition at line 99 of file company_base.h.

Referenced by CmdBuyCompany(), CompanyCheckBankrupt(), HandleBankruptcyTakeover(), and OnTick_Companies().

◆ bankrupt_timeout

int16_t CompanyProperties::bankrupt_timeout

If bigger than 0, amount of time to wait for an answer on an offer to buy this company.

Definition at line 100 of file company_base.h.

Referenced by CompanyCheckBankrupt(), and HandleBankruptcyTakeover().

◆ bankrupt_value

Money CompanyProperties::bankrupt_value

Definition at line 101 of file company_base.h.

◆ block_preview

uint8_t CompanyProperties::block_preview

Number of quarters that the company is not allowed to get new exclusive engine previews (see CompaniesGenStatistics).

Definition at line 89 of file company_base.h.

◆ build_object_limit

uint32_t CompanyProperties::build_object_limit

Amount of tiles we can (still) build objects on (times 65536). Also applies to buying land.

Definition at line 106 of file company_base.h.

Referenced by CmdBuildObject(), and CmdBuildObjectArea().

◆ clear_limit

uint32_t CompanyProperties::clear_limit

Amount of tiles we can (still) clear (times 65536).

Definition at line 104 of file company_base.h.

Referenced by CmdClearArea(), and CmdLandscapeClear().

◆ colour

◆ cur_economy

CompanyEconomyEntry CompanyProperties::cur_economy

Economic data of the company of this quarter.

Definition at line 115 of file company_base.h.

Referenced by DeliverGoods(), and SubtractMoneyFromAnyCompany().

◆ current_loan

◆ engine_renew_list

◆ face

◆ inaugurated_year

TimerGameEconomy::Year CompanyProperties::inaugurated_year

Economy year of starting the company.

Definition at line 94 of file company_base.h.

Referenced by DoStartupNewCompany(), and ServerNetworkAdminSocketHandler::SendCompanyInfo().

◆ inaugurated_year_calendar

TimerGameCalendar::Year CompanyProperties::inaugurated_year_calendar

Calendar year of starting the company. Used to display proper Inauguration year while in wallclock mode.

Definition at line 95 of file company_base.h.

Referenced by DoStartupNewCompany().

◆ is_ai

bool CompanyProperties::is_ai

If true, the company is (also) controlled by the computer (a NoAI program).

Note
It is possible that the user is also participating in such a company.

Definition at line 112 of file company_base.h.

Referenced by CmdBuildBridge(), CmdBuyCompany(), CmdCompanyCtrl(), GenerateCompanyName(), IndustriesScopeResolver::GetVariable(), Company::IsValidAiID(), Company::IsValidHumanID(), CompanyWindow::OnPaint(), and ServerNetworkAdminSocketHandler::SendCompanyInfo().

◆ last_build_coordinate

TileIndex CompanyProperties::last_build_coordinate

Coordinate of the last build thing by this company.

Definition at line 92 of file company_base.h.

Referenced by GenerateCompanyName(), and CommandHelperBase::InternalExecuteProcessResult().

◆ livery

Livery CompanyProperties::livery[LS_END]

Definition at line 119 of file company_base.h.

◆ location_of_HQ

TileIndex CompanyProperties::location_of_HQ

Northern tile of HQ; INVALID_TILE when there is none.

Definition at line 91 of file company_base.h.

Referenced by CmdBuildObject(), CompanyWindow::OnPaint(), and UpdateCompanyRatingAndValue().

◆ max_loan

Money CompanyProperties::max_loan

Max allowed amount of the loan or COMPANY_MAX_LOAN_DEFAULT.

Definition at line 85 of file company_base.h.

Referenced by CmdSetCompanyMaxLoan(), and Company::GetMaxLoan().

◆ money

◆ money_fraction

uint8_t CompanyProperties::money_fraction

Fraction of money of the company, too small to represent in money.

Definition at line 83 of file company_base.h.

Referenced by SubtractMoneyFromCompanyFract().

◆ months_empty

uint8_t CompanyProperties::months_empty = 0

NOSAVE: Number of months this company has not had a client in multiplayer.

Definition at line 97 of file company_base.h.

Referenced by ServerNetworkGameSocketHandler::Receive_CLIENT_IDENTIFY().

◆ months_of_bankruptcy

uint8_t CompanyProperties::months_of_bankruptcy

Number of months that the company is unable to pay its debts.

Definition at line 98 of file company_base.h.

Referenced by CompanyCheckBankrupt(), ServerNetworkAdminSocketHandler::SendCompanyInfo(), and ServerNetworkAdminSocketHandler::SendCompanyUpdate().

◆ name

std::string CompanyProperties::name

Name of the company if the user changed it.

Definition at line 72 of file company_base.h.

Referenced by CmdRenameCompany(), CmdRenamePresident(), FormatString(), IsUniqueCompanyName(), and NetworkOnGameStart().

◆ name_1

StringID CompanyProperties::name_1

Name of the company if the user did not change it.

Definition at line 71 of file company_base.h.

Referenced by CmdRenamePresident(), FormatString(), GenerateCompanyName(), NetworkOnGameStart(), and OnTick_Companies().

◆ name_2

uint32_t CompanyProperties::name_2

Parameter of name_1.

Definition at line 70 of file company_base.h.

Referenced by FormatString(), and GenerateCompanyName().

◆ num_valid_stat_ent

uint8_t CompanyProperties::num_valid_stat_ent

Number of valid statistical entries in old_economy.

Definition at line 117 of file company_base.h.

Referenced by UpdateCompanyRatingAndValue(), and BaseGraphWindow::UpdateStatistics().

◆ old_economy

◆ president_name

std::string CompanyProperties::president_name

Name of the president if the user changed it.

Definition at line 76 of file company_base.h.

Referenced by CmdRenamePresident(), FormatString(), and IsUniquePresidentName().

◆ president_name_1

StringID CompanyProperties::president_name_1

Name of the president if the user did not change it.

Definition at line 74 of file company_base.h.

Referenced by FormatString(), GenerateCompanyName(), and GeneratePresidentName().

◆ president_name_2

uint32_t CompanyProperties::president_name_2

Parameter of president_name_1.

Definition at line 75 of file company_base.h.

Referenced by FormatString(), GenerateCompanyName(), and GeneratePresidentName().

◆ settings

◆ terraform_limit

uint32_t CompanyProperties::terraform_limit

Amount of tileheights we can (still) terraform (times 65536).

Definition at line 103 of file company_base.h.

Referenced by CmdLevelLand(), and CmdTerraformLand().

◆ tree_limit

uint32_t CompanyProperties::tree_limit

Amount of trees we can (still) plant (times 65536).

Definition at line 105 of file company_base.h.

Referenced by CmdPlantTree().

◆ yearly_expenses

std::array<Expenses, 3> CompanyProperties::yearly_expenses {}

Expenses of the company for the last three years.

Definition at line 114 of file company_base.h.

Referenced by CompanyFinancesWindow::DrawWidget(), and SubtractMoneyFromAnyCompany().


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