OpenTTD Source 20250312-master-gcdcc6b491d
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 = 0
 Parameter of name_1.
 
StringID name_1 = INVALID_STRING_ID
 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 = INVALID_STRING_ID
 Name of the president if the user did not change it.
 
uint32_t president_name_2 = 0
 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 = 0
 Money owned by the company.
 
uint8_t money_fraction = 0
 Fraction of money of the company, too small to represent in money.
 
Money current_loan = 0
 Amount of money borrowed from the bank.
 
Money max_loan = COMPANY_MAX_LOAN_DEFAULT
 Max allowed amount of the loan or COMPANY_MAX_LOAN_DEFAULT.
 
Colours colour = COLOUR_BEGIN
 Company colour.
 
uint8_t block_preview = 0
 Number of quarters that the company is not allowed to get new exclusive engine previews (see CompaniesGenStatistics).
 
TileIndex location_of_HQ = INVALID_TILE
 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 = 0
 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 = 0
 If bigger than 0, amount of time to wait for an answer on an offer to buy this company.
 
Money bankrupt_value = 0
 
uint32_t terraform_limit = 0
 Amount of tileheights we can (still) terraform (times 65536).
 
uint32_t clear_limit = 0
 Amount of tiles we can (still) clear (times 65536).
 
uint32_t tree_limit = 0
 Amount of trees we can (still) plant (times 65536).
 
uint32_t build_object_limit = 0
 Amount of tiles we can (still) build objects on (times 65536). Also applies to buying land.
 
bool is_ai = false
 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.
 
std::array< CompanyEconomyEntry, MAX_HISTORY_QUARTERSold_economy {}
 Economic data of the company of the last MAX_HISTORY_QUARTERS quarters.
 
uint8_t num_valid_stat_ent = 0
 Number of valid statistical entries in old_economy.
 
std::array< Livery, LS_END > livery {}
 
EngineRenewList engine_renew_list = nullptr
 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.

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 = 0

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 = 0

Definition at line 101 of file company_base.h.

◆ block_preview

uint8_t CompanyProperties::block_preview = 0

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 = 0

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 = 0

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(), CompanyWindow::GetWidgetString(), 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(), and CompanyWindow::GetWidgetString().

◆ is_ai

bool CompanyProperties::is_ai = false

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

std::array<Livery, LS_END> CompanyProperties::livery {}

Definition at line 119 of file company_base.h.

◆ location_of_HQ

TileIndex CompanyProperties::location_of_HQ = INVALID_TILE

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 = COMPANY_MAX_LOAN_DEFAULT

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 = 0

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 = 0

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(), NetworkOnGameStart(), and SaveHighScoreValueNetwork().

◆ name_1

StringID CompanyProperties::name_1 = INVALID_STRING_ID

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 = 0

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 = 0

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 = INVALID_STRING_ID

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 = 0

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 = 0

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 = 0

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: