OpenTTD Source 20260206-master-g4d4e37dbf1
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 GetRoadTramTotal (RoadTramType rtt) const
 Get total sum of all owned road bits.
uint32_t GetRoadTotal () const
uint32_t GetTramTotal () const

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

Get total sum of all owned track bits.

Definition at line 43 of file company_base.h.

◆ GetRoadTotal()

uint32_t CompanyInfrastructure::GetRoadTotal ( ) const
inline

Definition at line 50 of file company_base.h.

◆ GetRoadTramTotal()

uint32_t CompanyInfrastructure::GetRoadTramTotal ( RoadTramType rtt) const

Get total sum of all owned road bits.

Parameters
rttRoadTramType to get total for.
Returns
Combined total road road bits.

Definition at line 1304 of file company_cmd.cpp.

References GetMaskForRoadTramType(), and road.

◆ GetTramTotal()

uint32_t CompanyInfrastructure::GetTramTotal ( ) const
inline

Definition at line 51 of file company_base.h.

Field Documentation

◆ airport

uint32_t CompanyInfrastructure::airport = 0

Count of company owned airports.

Definition at line 38 of file company_base.h.

◆ rail

std::array<uint32_t, RAILTYPE_END> CompanyInfrastructure::rail {}

Count of company owned track bits for each rail type.

Definition at line 33 of file company_base.h.

Referenced by AfterLoadCompanyStats(), CmdBuildBridge(), CmdBuildRailStation(), CmdBuildRoad(), CmdBuildTunnel(), CmdConvertRail(), and RemoveRoad().

◆ road

std::array<uint32_t, ROADTYPE_END> CompanyInfrastructure::road {}

Count of company owned track bits for each road type.

Definition at line 34 of file company_base.h.

Referenced by AfterLoadCompanyStats(), CmdBuildBridge(), CmdBuildTunnel(), ConvertRoadTypeOwner(), GetRoadTramTotal(), and UpdateCompanyRoadInfrastructure().

◆ signal

uint32_t CompanyInfrastructure::signal = 0

Count of company owned signals.

Definition at line 35 of file company_base.h.

Referenced by AfterLoadCompanyStats().

◆ station

uint32_t CompanyInfrastructure::station = 0

Count of company owned station tiles.

Definition at line 37 of file company_base.h.

Referenced by AfterLoadCompanyStats(), CmdBuildRailStation(), and CmdBuildRailWaypoint().

◆ water

uint32_t CompanyInfrastructure::water = 0

Count of company owned track bits for canals.

Definition at line 36 of file company_base.h.

Referenced by AfterLoadCompanyStats(), CmdBuildBridge(), DoBuildLock(), and RemoveLock().


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