OpenTTD Source 20250312-master-gcdcc6b491d
CompanyInfrastructure Struct Reference

Public Member Functions

auto operator<=> (const CompanyInfrastructure &) const =default
 
uint32_t GetRailTotal () const
 Get total sum of all owned track bits.
 
uint32_t GetRoadTotal () const
 Get total sum of all owned road bits.
 
uint32_t GetTramTotal () const
 Get total sum of all owned tram bits.
 

Data Fields

std::array< uint32_t, RAILTYPE_ENDrail {}
 Count of company owned track bits for each rail type.
 
std::array< uint32_t, ROADTYPE_ENDroad {}
 Count of company owned track bits for each road type.
 
uint32_t signal = 0
 Count of company owned signals.
 
uint32_t water = 0
 Count of company owned track bits for canals.
 
uint32_t station = 0
 Count of company owned station tiles.
 
uint32_t airport = 0
 Count of company owned airports.
 

Detailed Description

Definition at line 32 of file company_base.h.

Member Function Documentation

◆ GetRailTotal()

uint32_t CompanyInfrastructure::GetRailTotal ( ) const
inline

◆ GetRoadTotal()

uint32_t CompanyInfrastructure::GetRoadTotal ( ) const

Get total sum of all owned road bits.

Returns
Combined total road road bits.

Definition at line 1258 of file company_cmd.cpp.

References road, ROADTYPE_BEGIN, and ROADTYPE_END.

Referenced by CompanyInfrastructureWindow::DrawWidget(), CompanyInfrastructureWindow::GetTotalMaintenanceCost(), and CompanyInfrastructureWindow::UpdateWidgetSize().

◆ GetTramTotal()

uint32_t CompanyInfrastructure::GetTramTotal ( ) const

Get total sum of all owned tram bits.

Returns
Combined total of tram road bits.

Definition at line 1271 of file company_cmd.cpp.

References road, ROADTYPE_BEGIN, and ROADTYPE_END.

Referenced by CompanyInfrastructureWindow::DrawWidget(), CompanyInfrastructureWindow::GetTotalMaintenanceCost(), and CompanyInfrastructureWindow::UpdateWidgetSize().

Field Documentation

◆ airport

uint32_t CompanyInfrastructure::airport = 0

Count of company owned airports.

Definition at line 38 of file company_base.h.

Referenced by CompanyInfrastructureWindow::DrawWidget(), and CompanyInfrastructureWindow::UpdateWidgetSize().

◆ rail

◆ road

◆ signal

uint32_t CompanyInfrastructure::signal = 0

◆ station

uint32_t CompanyInfrastructure::station = 0

◆ water

uint32_t CompanyInfrastructure::water = 0

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