|
OpenTTD Source 20251104-master-g3befbdd52f
|
Base of all industries. More...
#include "core/flatset_type.hpp"#include "misc/history_type.hpp"#include "newgrf_storage.h"#include "subsidy_type.h"#include "industry_map.h"#include "industrytype.h"#include "tilearea_type.h"#include "station_base.h"#include "timer/timer_game_calendar.h"#include "timer/timer_game_economy.h"Go to the source code of this file.
Data Structures | |
| struct | Industry |
| Defines the internal data of a functional industry. More... | |
| struct | Industry::ProducedHistory |
| struct | Industry::ProducedCargo |
| struct | Industry::AcceptedHistory |
| struct | Industry::AcceptedCargo |
| struct | IndustryTypeBuildData |
| Data for managing the number of industries of a single industry type. More... | |
| struct | IndustryBuildData |
| Data for managing the number and type of industries in the game. More... | |
Typedefs | |
| typedef Pool< Industry, IndustryID, 64 > | IndustryPool |
| using | IndustryControlFlags = EnumBitSet< IndustryControlFlag, uint8_t, IndustryControlFlag::End > |
Enumerations | |
| enum class | IndustryControlFlag : uint8_t { NoProductionDecrease = 0 , NoProductionIncrease = 1 , NoClosure = 2 , ExternalProdLevel = 3 , End } |
| Flags to control/override the behaviour of an industry. More... | |
| enum | IndustryDirectoryInvalidateWindowData : uint8_t { IDIWD_FORCE_REBUILD , IDIWD_PRODUCTION_CHANGE , IDIWD_FORCE_RESORT } |
| Special values for the industry list window for the data parameter of InvalidateWindowData. More... | |
Functions | |
| void | ClearAllIndustryCachedNames () |
| void | PlantRandomFarmField (const Industry *i) |
| void | ReleaseDisastersTargetingIndustry (IndustryID) |
| Marks all disasters targeting this industry in such a way they won't call Industry::Get(v->dest_tile) on invalid industry anymore. | |
| bool | IsTileForestIndustry (TileIndex tile) |
| Check whether the tile is a forest. | |
| void | TrimIndustryAcceptedProduced (Industry *ind) |
| Remove unused industry accepted/produced slots – entries after the last slot with valid cargo. | |
Variables | |
| IndustryPool | _industry_pool |
| static const TimerGameEconomy::Year | PROCESSING_INDUSTRY_ABANDONMENT_YEARS {5} |
| If a processing industry doesn't produce for this many consecutive economy years, it may close. | |
| static constexpr uint8_t | PRODLEVEL_CLOSURE = 0x00 |
| signal set to actually close the industry | |
| static constexpr uint8_t | PRODLEVEL_MINIMUM = 0x04 |
| below this level, the industry is set to be closing | |
| static constexpr uint8_t | PRODLEVEL_DEFAULT = 0x10 |
| default level set when the industry is created | |
| static constexpr uint8_t | PRODLEVEL_MAXIMUM = 0x80 |
| the industry is running at full speed | |
| IndustryBuildData | _industry_builder |
| In-game manager of industries. | |
Base of all industries.
Definition in file industry.h.
| using IndustryControlFlags = EnumBitSet<IndustryControlFlag, uint8_t, IndustryControlFlag::End> |
Definition at line 57 of file industry.h.
| typedef Pool<Industry, IndustryID, 64> IndustryPool |
Definition at line 25 of file industry.h.
|
strong |
Flags to control/override the behaviour of an industry.
These flags are controlled by game scripts.
| Enumerator | |
|---|---|
| NoProductionDecrease | When industry production change is evaluated, rolls to decrease are ignored. |
| NoProductionIncrease | When industry production change is evaluated, rolls to increase are ignored. |
| NoClosure | Industry can not close regardless of production level or time since last delivery. This does not prevent a closure already announced. |
| ExternalProdLevel | Indicates that the production level of the industry is externally controlled. |
Definition at line 44 of file industry.h.
| enum IndustryDirectoryInvalidateWindowData : uint8_t |
Special values for the industry list window for the data parameter of InvalidateWindowData.
Definition at line 322 of file industry.h.
| void ClearAllIndustryCachedNames | ( | ) |
Definition at line 2601 of file industry_cmd.cpp.
| bool IsTileForestIndustry | ( | TileIndex | tile | ) |
Check whether the tile is a forest.
| tile | the tile to investigate. |
Definition at line 978 of file industry_cmd.cpp.
References Industry::GetByTile(), GetIndustrySpec(), IsTileType(), IndustrySpec::life_type, MP_INDUSTRY, Organic, Industry::produced, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and Industry::type.
Referenced by GenerateStationName(), and GetSmallMapVegetationPixels().
| void PlantRandomFarmField | ( | const Industry * | i | ) |
Definition at line 1092 of file industry_cmd.cpp.
| void ReleaseDisastersTargetingIndustry | ( | IndustryID | i | ) |
Marks all disasters targeting this industry in such a way they won't call Industry::Get(v->dest_tile) on invalid industry anymore.
| i | deleted industry |
Definition at line 962 of file disaster_vehicle.cpp.
References Vehicle::dest_tile, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_vehicle_pool >::Iterate(), ST_AIRPLANE, ST_HELICOPTER, DisasterVehicle::state, and Vehicle::subtype.
| void TrimIndustryAcceptedProduced | ( | Industry * | ind | ) |
Remove unused industry accepted/produced slots – entries after the last slot with valid cargo.
| ind | Industry to trim slots. |
Definition at line 3285 of file industry_cmd.cpp.
References Industry::accepted, and Industry::produced.
Referenced by AfterLoadGame().
|
extern |
In-game manager of industries.
Definition at line 73 of file industry_cmd.cpp.
Referenced by AfterLoadGame(), GenerateIndustries(), ITBLChunkHandler::Load(), and ITBLChunkHandler::Save().
|
static |
If a processing industry doesn't produce for this many consecutive economy years, it may close.
Definition at line 28 of file industry.h.
Referenced by ChangeIndustryProduction().
|
staticconstexpr |
signal set to actually close the industry
Definition at line 35 of file industry.h.
Referenced by ChangeIndustryProduction(), and IndustryViewWindow::DrawInfo().
|
staticconstexpr |
default level set when the industry is created
Definition at line 37 of file industry.h.
Referenced by DoCreateNewIndustry(), IndustryViewWindow::DrawInfo(), IndustryViewWindow::OnClick(), IndustryViewWindow::OnQueryTextFinished(), and Industry::RecomputeProductionMultipliers().
|
staticconstexpr |
the industry is running at full speed
Definition at line 38 of file industry.h.
Referenced by ChangeIndustryProduction(), CmdIndustrySetProduction(), DoCreateNewIndustry(), IndustryViewWindow::DrawInfo(), IndustryViewWindow::OnClick(), and IndustryViewWindow::OnQueryTextFinished().
|
staticconstexpr |
below this level, the industry is set to be closing
Definition at line 36 of file industry.h.
Referenced by ChangeIndustryProduction(), IndustryViewWindow::DrawInfo(), IndustryViewWindow::OnClick(), and IndustryViewWindow::OnQueryTextFinished().