OpenTTD Source 20260206-master-g4d4e37dbf1
IndustryBuildData Struct Reference

Data for managing the number and type of industries in the game. More...

#include <industry.h>

Public Member Functions

void Reset ()
 Completely reset the industry build data.
void SetupTargetCount ()
 Decide how many industries of each type are needed.
void TryBuildNewIndustry ()
 Try to create a random industry, during gameplay.
void EconomyMonthlyLoop ()
 Monthly update of industry build data.

Data Fields

IndustryTypeBuildData builddata [NUM_INDUSTRYTYPES]
 Industry build data for every industry type.
uint32_t wanted_inds
 Number of wanted industries (bits 31-16), and a fraction (bits 15-0).

Detailed Description

Data for managing the number and type of industries in the game.

Definition at line 306 of file industry.h.

Member Function Documentation

◆ EconomyMonthlyLoop()

void IndustryBuildData::EconomyMonthlyLoop ( )

Monthly update of industry build data.

Definition at line 2448 of file industry_cmd.cpp.

References _settings_game, FundedOnly, GetCurrentTotalNumberOfIndustries(), Map::ScaleBySize(), and wanted_inds.

◆ Reset()

void IndustryBuildData::Reset ( )

Completely reset the industry build data.

Definition at line 2438 of file industry_cmd.cpp.

References builddata, GetCurrentTotalNumberOfIndustries(), NUM_INDUSTRYTYPES, and wanted_inds.

◆ SetupTargetCount()

void IndustryBuildData::SetupTargetCount ( )

◆ TryBuildNewIndustry()

void IndustryBuildData::TryBuildNewIndustry ( )

Field Documentation

◆ builddata

IndustryTypeBuildData IndustryBuildData::builddata[NUM_INDUSTRYTYPES]

Industry build data for every industry type.

Definition at line 307 of file industry.h.

Referenced by Reset(), SetupTargetCount(), and TryBuildNewIndustry().

◆ wanted_inds

uint32_t IndustryBuildData::wanted_inds

Number of wanted industries (bits 31-16), and a fraction (bits 15-0).

Definition at line 308 of file industry.h.

Referenced by EconomyMonthlyLoop(), Reset(), and SetupTargetCount().


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