OpenTTD Source
20241109-master-g5e4f8db7d6
|
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_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. More... | |
const IndustryTileSpec * | GetIndustryTileSpec (IndustryGfx gfx) |
Array of industry tiles data. More... | |
void | ResetIndustries () |
This function initialize the spec arrays of both industry and industry tiles. More... | |
void | SortIndustryTypes () |
Initialize the list of sorted industry types. | |
IndustryGfx | GetTranslatedIndustryTileID (IndustryGfx gfx) |
Do industry gfx ID translation for NewGRFs. More... | |
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. | |
static const uint8_t | IT_INVALID = 255 |
Industry type specs.
Definition in file industrytype.h.
enum CheckProc |
Available procedures to check whether an industry may build at a given location.
Definition at line 33 of file industrytype.h.
enum IndustryBehaviour |
Various industry behaviours mostly to represent original TTD specialities.
Definition at line 55 of file industrytype.h.
How was the industry created.
Definition at line 47 of file industrytype.h.
enum IndustryLifeType |
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 22 of file industrytype.h.
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 82 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 AdvertiseIndustryOpening(), BuildIndustriesLegend(), ChangeIndustryProduction(), CheckIfFarEnoughFromConflictingIndustry(), CheckIfIndustryIsAllowed(), CheckIfIndustryTilesAreFree(), CheckIndustries(), CheckIndustryCloseDownProtection(), CmdBuildIndustry(), CmdIndustrySetProduction(), CMSAMine(), IndustryCargoesWindow::ComputeCargoDisplay(), IndustryCargoesWindow::ComputeIndustryDisplay(), IndustryCargoesWindow::CountMatchingAcceptingIndustries(), IndustryCargoesWindow::CountMatchingProducingIndustries(), CreateNewIndustry(), Disaster_Helicopter_Init(), IndustryViewWindow::DrawInfo(), FindNearIndustryName(), GetCountAndDistanceOfClosestInstance(), IndustriesResolverObject::GetDebugID(), GetGrffile(), NIHIndustry::GetGRFID(), GetIndustryProbabilityCallback(), IndustryDirectoryWindow::GetIndustryString(), GetScaledIndustryGenerationProbability(), NIHIndustry::GetSpec(), IndustriesScopeResolver::GetVariable(), IndustriesResolverObject::IndustriesResolverObject(), IndustryProductionCallback(), IndustryTemporarilyRefusesCargo(), IndustryTypeNameSorter(), NIHIndustry::IsInspectable(), IsTileForestIndustry(), IndustryCargoesWindow::OnInit(), Industry::RecomputeProductionMultipliers(), ShowIndustryCargoesWindow(), TransportIndustryGoods(), and TriggerIndustryProduction().
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 INVALID_INDUSTRYTILE.
Referenced by CheckIfIndustryTilesAreFree(), 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 187 of file industrytype.h.
References INVALID_INDUSTRYTILE.
Referenced by CheckIfIndustryTilesAreFree(), 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.