OpenTTD
|
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. More... | |
void | SetupTargetCount () |
Decide how many industries of each type are needed. More... | |
void | TryBuildNewIndustry () |
Try to create a random industry, during gameplay. | |
void | MonthlyLoop () |
Monthly update of industry build data. More... | |
Data Fields | |
IndustryTypeBuildData | builddata [NUM_INDUSTRYTYPES] |
Industry build data for every industry type. | |
uint32 | wanted_inds |
Number of wanted industries (bits 31-16), and a fraction (bits 15-0). | |
Data for managing the number and type of industries in the game.
Definition at line 170 of file industry.h.
void IndustryBuildData::MonthlyLoop | ( | ) |
Monthly update of industry build data.
Definition at line 2099 of file industry_cmd.cpp.
References _settings_game, GameSettings::difficulty, GetCurrentTotalNumberOfIndustries(), ID_FUND_ONLY, DifficultySettings::industry_density, min(), and ScaleByMapSize().
void IndustryBuildData::Reset | ( | ) |
Completely reset the industry build data.
Definition at line 2089 of file industry_cmd.cpp.
References GetCurrentTotalNumberOfIndustries(), and NUM_INDUSTRYTYPES.
void IndustryBuildData::SetupTargetCount | ( | ) |
Decide how many industries of each type are needed.
Definition at line 2218 of file industry_cmd.cpp.
References IndustryTypeBuildData::min_number, NUM_INDUSTRYTYPES, IndustryTypeBuildData::probability, RandomRange(), and IndustryTypeBuildData::target_count.