OpenTTD
|
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 | IndustryTileTable |
struct | IndustrySpec |
Defines the data structure for constructing industry. More... | |
struct | IndustryTileSpec |
Defines the data structure of each individual tile of an industry. More... |
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. | |
static IndustryGfx | GetTranslatedIndustryTileID (IndustryGfx gfx) |
Do industry gfx ID translation for NewGRFs. |
Variables | |
IndustrySpec | _industry_specs [NUM_INDUSTRYTYPES] |
IndustryTileSpec | _industry_tile_specs [NUM_INDUSTRYTILES] |
IndustryType | _sorted_industry_types [NUM_INDUSTRYTYPES] |
Industry types sorted by name. | |
static const uint8 | 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 40 of file industrytype.h.
enum IndustryBehaviour |
Various industry behaviours mostly to represent original TTD specialities.
Definition at line 62 of file industrytype.h.
enum IndustryCleanupType |
CLEAN_RANDOMSOUNDS |
Free the dynamically allocated sounds table. |
CLEAN_TILELAYOUT |
Free the dynamically allocated tile layout structure. |
Definition at line 23 of file industrytype.h.
How was the industry created.
Definition at line 54 of file industrytype.h.
enum IndustryLifeType |
Available types of industry lifetimes.
INDUSTRYLIFE_BLACK_HOLE |
Like power plants and banks. |
INDUSTRYLIFE_EXTRACTIVE |
Like mines. |
INDUSTRYLIFE_ORGANIC |
Like forests. |
INDUSTRYLIFE_PROCESSING |
Like factories. |
Definition at line 29 of file industrytype.h.
Flags for miscellaneous industry tile specialities.
Definition at line 87 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 116 of file industry_cmd.cpp.
References NUM_INDUSTRYTYPES.
Referenced by IndustryOverrideManager::AddEntityID(), AdvertiseIndustryOpening(), AfterLoadGame(), BuildIndustriesLegend(), CcBuildIndustry(), ChangeIndustryProduction(), CheckIfCallBackAllowsCreation(), CheckIfFarEnoughFromConflictingIndustry(), CheckIfIndustryIsAllowed(), CheckIfIndustryTilesAreFree(), CheckIndustries(), CheckIndustryCloseDownProtection(), CmdBuildIndustry(), 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(), GetAiPurchaseCallbackResult(), GetCountAndDistanceOfClosestInstance(), GetGrffile(), GetIndustryGamePlayProbability(), GetIndustryProbabilityCallback(), IndustryDirectoryWindow::GetIndustryString(), GetScaledIndustryGenerationProbability(), SmallMapWindow::GetTileColours(), IndustriesScopeResolver::GetVariable(), IndustriesResolverObject::IndustriesResolverObject(), IndustryProductionCallback(), IndustryTemporarilyRefusesCargo(), IndustryTypeNameSorter(), IsTileForestIndustry(), BuildIndustryWindow::OnClick(), IndustryCargoesWindow::OnClick(), IndustryCargoesWindow::OnInit(), BuildIndustryWindow::OnInvalidateData(), IndustryViewWindow::OnInvalidateData(), BuildIndustryWindow::OnPlaceObject(), BuildIndustryWindow::OnTick(), Industry::RecomputeProductionMultipliers(), BuildIndustryWindow::SetStringParameters(), IndustryCargoesWindow::SetStringParameters(), ShowIndustryCargoesWindow(), IndustriesScopeResolver::StorePSA(), 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 130 of file industry_cmd.cpp.
References INVALID_INDUSTRYTILE.
Referenced by CheckIfIndustryTilesAreFree(), DoCreateNewIndustry(), DoTriggerIndustryTile(), GetIndTileGrffile(), GetIndustryIDAtOffset(), and IndustryTileResolverObject::IndustryTileResolverObject().
|
inlinestatic |
Do industry gfx ID translation for NewGRFs.
gfx | the type to get the override for. |
Definition at line 186 of file industrytype.h.
References IndustryTileSpec::grf_prop, INVALID_INDUSTRYTILE, and GRFFileProps::override.
Referenced by CheckIfIndustryTilesAreFree(), 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 72 of file industry_cmd.cpp.
References _settings_game, IndustrySpec::enabled, GameSettings::game_creation, HasBit(), GameCreationSettings::landscape, NEW_INDUSTRYOFFSET, NUM_INDUSTRYTYPES, and OverrideManagerBase::ResetOverride().
Referenced by ResetNewGRFData().