OpenTTD Source 20250205-master-gfd85ab1e2c
|
Industry type specs. More...
#include "map_type.h"
#include "slope_type.h"
#include "industry_type.h"
#include "landscape_type.h"
#include "cargo_type.h"
#include "newgrf_animation_type.h"
#include "newgrf_callbacks.h"
#include "newgrf_commons.h"
Go to the source code of this file.
Data Structures | |
struct | IndustryTileLayoutTile |
Definition of one tile in an industry tile layout. More... | |
struct | IndustrySpec |
Defines the data structure for constructing industry. More... | |
struct | IndustryTileSpec |
Defines the data structure of each individual tile of an industry. More... | |
Typedefs | |
using | IndustryTileLayout = std::vector< IndustryTileLayoutTile > |
A complete tile layout for an industry is a list of tiles. | |
Functions | |
const IndustrySpec * | GetIndustrySpec (IndustryType thistype) |
Array of industries data. | |
const IndustryTileSpec * | GetIndustryTileSpec (IndustryGfx gfx) |
Array of industry tiles data. | |
void | ResetIndustries () |
This function initialize the spec arrays of both industry and industry tiles. | |
void | SortIndustryTypes () |
Initialize the list of sorted industry types. | |
IndustryGfx | GetTranslatedIndustryTileID (IndustryGfx gfx) |
Do industry gfx ID translation for NewGRFs. | |
Variables | |
IndustrySpec | _industry_specs [NUM_INDUSTRYTYPES] |
IndustryTileSpec | _industry_tile_specs [NUM_INDUSTRYTILES] |
std::array< IndustryType, NUM_INDUSTRYTYPES > | _sorted_industry_types |
Industry types sorted by name. | |
Industry type specs.
Definition in file industrytype.h.
using IndustryTileLayout = std::vector<IndustryTileLayoutTile> |
A complete tile layout for an industry is a list of tiles.
Definition at line 97 of file industrytype.h.
enum CheckProc : uint8_t |
Available procedures to check whether an industry may build at a given location.
Definition at line 34 of file industrytype.h.
enum IndustryBehaviour : uint32_t |
Various industry behaviours mostly to represent original TTD specialities.
Definition at line 56 of file industrytype.h.
enum IndustryConstructionType : uint8_t |
How was the industry created.
Definition at line 48 of file industrytype.h.
enum IndustryLifeType : uint8_t |
Available types of industry lifetimes.
Enumerator | |
---|---|
INDUSTRYLIFE_BLACK_HOLE | Like power plants and banks. |
INDUSTRYLIFE_EXTRACTIVE | Like mines. |
INDUSTRYLIFE_ORGANIC | Like forests. |
INDUSTRYLIFE_PROCESSING | Like factories. |
Definition at line 23 of file industrytype.h.
enum IndustryTileSpecialFlags : uint8_t |
Flags for miscellaneous industry tile specialities.
Enumerator | |
---|---|
INDTILE_SPECIAL_NEXTFRAME_RANDOMBITS | Callback 0x26 needs random bits. |
INDTILE_SPECIAL_ACCEPTS_ALL_CARGO | Tile always accepts all cargoes the associated industry accepts. |
Definition at line 83 of file industrytype.h.
const IndustrySpec * GetIndustrySpec | ( | IndustryType | thistype | ) |
Array of industries data.
Array of industries data.
This will ensure at once : proper access and not allowing modifications of it.
thistype | of industry (which is the index in _industry_specs) |
Definition at line 123 of file industry_cmd.cpp.
References NUM_INDUSTRYTYPES.
Referenced by IndustryOverrideManager::AddEntityID(), AdvertiseIndustryOpening(), AfterLoadGame(), BuildIndustriesLegend(), CcBuildIndustry(), ChangeIndustryProduction(), CheckIfCallBackAllowsCreation(), CheckIfFarEnoughFromConflictingIndustry(), CheckIfIndustryIsAllowed(), CheckIfIndustryTilesAreFree(), CheckIndustries(), CheckIndustryCloseDownProtection(), CmdBuildIndustry(), CmdIndustrySetProduction(), CMSAMine(), IndustryCargoesWindow::ComputeCargoDisplay(), IndustryCargoesWindow::ComputeIndustryDisplay(), CargoesRow::ConnectIndustryAccepted(), CargoesRow::ConnectIndustryProduced(), IndustryCargoesWindow::CountMatchingAcceptingIndustries(), IndustryCargoesWindow::CountMatchingProducingIndustries(), CreateNewIndustry(), CreateNewIndustryHelper(), Disaster_CoalMine_Init(), Disaster_Helicopter_Init(), DisasterTick_Aircraft(), DoCreateNewIndustry(), CargoesField::Draw(), IndustryViewWindow::DrawInfo(), BuildIndustryWindow::DrawWidget(), FindNearIndustryName(), FormatString(), GenerateStationName(), GetAiPurchaseCallbackResult(), GetCountAndDistanceOfClosestInstance(), IndustriesResolverObject::GetDebugID(), GetGrffile(), NIHIndustry::GetGRFID(), GetIndustryGamePlayProbability(), GetIndustryProbabilityCallback(), IndustryDirectoryWindow::GetIndustryString(), GetScaledIndustryGenerationProbability(), NIHIndustry::GetSpec(), SmallMapWindow::GetTileColours(), IndustriesScopeResolver::GetVariable(), IndustriesResolverObject::IndustriesResolverObject(), IndustryProductionCallback(), IndustryTemporarilyRefusesCargo(), IndustryTypeNameSorter(), NIHIndustry::IsInspectable(), IsTileForestIndustry(), BuildIndustryWindow::OnClick(), IndustryCargoesWindow::OnClick(), IndustryCargoesWindow::OnInit(), IndustryViewWindow::OnInvalidateData(), BuildIndustryWindow::OnPlaceObject(), Industry::RecomputeProductionMultipliers(), BuildIndustryWindow::SetStringParameters(), IndustryCargoesWindow::SetStringParameters(), ShowIndustryCargoesWindow(), IndustriesScopeResolver::StorePSA(), TransportIndustryGoods(), TriggerIndustryProduction(), and BuildIndustryWindow::UpdateWidgetSize().
const IndustryTileSpec * GetIndustryTileSpec | ( | IndustryGfx | gfx | ) |
Array of industry tiles data.
Array of industry tiles data.
This will ensure at once : proper access and not allowing modifications of it.
gfx | of industrytile (which is the index in _industry_tile_specs) |
Definition at line 137 of file industry_cmd.cpp.
References NUM_INDUSTRYTILES.
Referenced by CheckIfIndustryTilesAreFree(), CheckIfIndustryTileSlopes(), DoCreateNewIndustry(), DoTriggerIndustryTile(), IndustryTileResolverObject::GetDebugID(), NIHIndustryTile::GetGRFID(), GetIndTileGrffile(), GetIndustryIDAtOffset(), NIHIndustryTile::GetSpec(), IndustryTileResolverObject::IndustryTileResolverObject(), and NIHIndustryTile::IsInspectable().
|
inline |
Do industry gfx ID translation for NewGRFs.
gfx | the type to get the override for. |
Definition at line 190 of file industrytype.h.
References IndustryTileSpec::grf_prop, INVALID_INDUSTRYTILE, NUM_INDUSTRYTILES, and GRFFileProps::override.
Referenced by CheckIfIndustryTilesAreFree(), CheckIfIndustryTileSlopes(), DoCreateNewIndustry(), and GetIndustryGfx().
void ResetIndustries | ( | ) |
This function initialize the spec arrays of both industry and industry tiles.
It adjusts the enabling of the industry too, based on climate availability. This will allow for clearer testings
Definition at line 80 of file industry_cmd.cpp.
References _settings_game, GameSettings::game_creation, GameCreationSettings::landscape, and OverrideManagerBase::ResetOverride().
Referenced by ResetNewGRFData().
void SortIndustryTypes | ( | ) |
Initialize the list of sorted industry types.
Definition at line 238 of file industry_gui.cpp.
References _sorted_industry_types, IndustryTypeNameSorter(), and NUM_INDUSTRYTYPES.
Referenced by AfterLoadGRFs(), and ReadLanguagePack().
|
extern |
Definition at line 68 of file industry_cmd.cpp.
|
extern |
Definition at line 69 of file industry_cmd.cpp.
|
extern |
Industry types sorted by name.
Definition at line 224 of file industry_gui.cpp.
Referenced by BuildIndustriesLegend(), IndustryCargoesWindow::ComputeCargoDisplay(), IndustryCargoesWindow::ComputeIndustryDisplay(), IndustryDirectoryWindow::IndustryTypeSorter(), IndustryCargoesWindow::OnClick(), ShowIndustryCargoesWindow(), and SortIndustryTypes().