#include "economy_type.h"
#include "map_type.h"
#include "slope_type.h"
#include "industry_type.h"
#include "landscape_type.h"
#include "strings_type.h"
#include "cargo_type.h"
Go to the source code of this file.
Data Structures | |
struct | IndustryTileTable |
struct | GRFFileProps |
Data related to the handling of grf files. More... | |
struct | IndustrySpec |
Defines the data structure for constructing industry. More... | |
struct | IndustryTileSpec |
Defines the data structure of each indivudual tile of an industry. More... | |
Enumerations | |
enum | { CLEAN_RANDOMSOUNDS, CLEAN_TILELSAYOUT } |
enum | IndustryLifeType { INDUSTRYLIFE_BLACK_HOLE = 0, INDUSTRYLIFE_EXTRACTIVE = 1 << 0, INDUSTRYLIFE_ORGANIC = 1 << 1, INDUSTRYLIFE_PROCESSING = 1 << 2 } |
enum | CheckProc { CHECK_NOTHING, CHECK_FOREST, CHECK_REFINERY, CHECK_FARM, CHECK_PLANTATION, CHECK_WATER, CHECK_LUMBERMILL, CHECK_BUBBLEGEN, CHECK_OIL_RIG, CHECK_END } |
enum | IndustryConstructionType { ICT_UNKNOWN, ICT_NORMAL_GAMEPLAY, ICT_MAP_GENERATION, ICT_SCENARIO_EDITOR } |
How was the industry created. More... | |
enum | IndustryBehaviour { INDUSTRYBEH_NONE = 0, INDUSTRYBEH_PLANT_FIELDS = 1 << 0, INDUSTRYBEH_CUT_TREES = 1 << 1, INDUSTRYBEH_BUILT_ONWATER = 1 << 2, INDUSTRYBEH_TOWN1200_MORE = 1 << 3, INDUSTRYBEH_ONLY_INTOWN = 1 << 4, INDUSTRYBEH_ONLY_NEARTOWN = 1 << 5, INDUSTRYBEH_PLANT_ON_BUILT = 1 << 6, INDUSTRYBEH_DONT_INCR_PROD = 1 << 7, INDUSTRYBEH_BEFORE_1950 = 1 << 8, INDUSTRYBEH_AFTER_1960 = 1 << 9, INDUSTRYBEH_AI_AIRSHIP_ROUTES = 1 << 10, INDUSTRYBEH_AIRPLANE_ATTACKS = 1 << 11, INDUSTRYBEH_CHOPPER_ATTACKS = 1 << 12, INDUSTRYBEH_CAN_SUBSIDENCE = 1 << 13, INDUSTRYBEH_PROD_MULTI_HNDLING = 1 << 14, INDUSTRYBEH_PRODCALLBACK_RANDOM = 1 << 15, INDUSTRYBEH_NOBUILT_MAPCREATION = 1 << 16, INDUSTRYBEH_CANCLOSE_LASTINSTANCE = 1 << 17 } |
Functions | |
DECLARE_ENUM_AS_BIT_SET (IndustryBehaviour) | |
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. | |
static IndustryGfx | GetTranslatedIndustryTileID (IndustryGfx gfx) |
Do industry gfx ID translation for NewGRFs. | |
static void | IncIndustryTypeCount (IndustryType type) |
Increment the count of industries for this type. | |
static void | DecIndustryTypeCount (IndustryType type) |
Decrement the count of industries for this type. | |
static uint8 | GetIndustryTypeCount (IndustryType type) |
get the count of industries for this type | |
static void | ResetIndustryCounts () |
Resets both the total_industries and the _industry_counts This way, we centralize all counts activities. | |
Variables | |
IndustrySpec | _industry_specs [NUM_INDUSTRYTYPES] |
IndustryTileSpec | _industry_tile_specs [NUM_INDUSTRYTILES] |
uint16 | _industry_counts [NUM_INDUSTRYTYPES] |
Number of industries per type ingame. | |
static const uint8 | IT_INVALID = 255 |
Definition in file industrytype.h.
anonymous enum |
CLEAN_RANDOMSOUNDS | Free the dynamically allocated sounds table. |
CLEAN_TILELSAYOUT | Free the dynamically allocated tile layout structure. |
Definition at line 23 of file industrytype.h.
enum IndustryBehaviour |
Definition at line 58 of file industrytype.h.
How was the industry created.
Definition at line 51 of file industrytype.h.
enum IndustryLifeType |
INDUSTRYLIFE_BLACK_HOLE | Like power plants and banks. |
INDUSTRYLIFE_EXTRACTIVE | Like mines. |
INDUSTRYLIFE_ORGANIC | Like forests. |
INDUSTRYLIFE_PROCESSING | Like factories. |
Definition at line 28 of file industrytype.h.
static void DecIndustryTypeCount | ( | IndustryType | type | ) | [inline, static] |
Decrement the count of industries for this type.
type | IndustryType to decrement |
Definition at line 219 of file industrytype.h.
References _industry_counts, and INVALID_INDUSTRYTYPE.
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 118 of file industry_cmd.cpp.
References NUM_INDUSTRYTYPES.
Referenced by BuildIndustriesLegend(), AIIndustryType::BuildIndustry(), AIIndustryType::CanBuildIndustry(), CanCargoServiceIndustry(), AIIndustryType::CanProspectIndustry(), ChangeIndustryProduction(), CheckIndustryCloseDownProtection(), CmdBuildIndustry(), CMSAForest(), CMSAMine(), CreateNewIndustryHelper(), DeliverGoodsToIndustry(), Disaster_CoalMine_Init(), Disaster_Helicopter_Init(), DisasterTick_Aircraft(), BuildIndustryWindow::DrawWidget(), FindNearIndustryName(), GenerateIndustries(), AIIndustryType::GetAcceptedCargo(), AIIndustryType::GetConstructionCost(), GetCountAndDistanceOfClosestInstance(), GetIndustryIDAtOffset(), IndustryDirectoryWindow::GetIndustryString(), AIIndustryType::GetName(), AIIndustryType::GetProducedCargo(), GetSmallMapIndustriesPixels(), GetSmallMapVegetationPixels(), AIIndustryType::HasDock(), AIIndustry::HasDock(), AIIndustryType::HasHeliport(), AIIndustry::HasHeliport(), IndustryGetVariable(), IndustryProductionCallback(), AIIndustryType::IsBuiltOnWater(), AIIndustry::IsBuiltOnWater(), AIIndustryType::IsRawIndustry(), AIIndustryType::IsValidIndustryType(), MaybeNewIndustry(), BuildIndustryWindow::OnClick(), BuildIndustryWindow::OnInvalidateData(), BuildIndustryWindow::OnPlaceObject(), BuildIndustryWindow::OnTick(), PlaceInitialIndustry(), AIIndustryType::ProductionCanIncrease(), BuildIndustryWindow::SetStringParameters(), 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 132 of file industry_cmd.cpp.
References INVALID_INDUSTRYTILE.
Referenced by GetIndustryIDAtOffset().
static uint8 GetIndustryTypeCount | ( | IndustryType | type | ) | [inline, static] |
get the count of industries for this type
type | IndustryType to query |
Definition at line 228 of file industrytype.h.
References _industry_counts, INVALID_INDUSTRYTYPE, and min().
Referenced by CheckIndustryCloseDownProtection(), and GetCountAndDistanceOfClosestInstance().
static IndustryGfx GetTranslatedIndustryTileID | ( | IndustryGfx | gfx | ) | [inline, static] |
Do industry gfx ID translation for NewGRFs.
gfx | the type to get the override for. |
Definition at line 189 of file industrytype.h.
References IndustryTileSpec::grf_prop, INVALID_INDUSTRYTILE, and GRFFileProps::override.
Referenced by GetIndustryGfx().
static void IncIndustryTypeCount | ( | IndustryType | type | ) | [inline, static] |
Increment the count of industries for this type.
type | IndustryType to increment |
Definition at line 210 of file industrytype.h.
References _industry_counts, and INVALID_INDUSTRYTYPE.
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 68 of file industry_cmd.cpp.
References _settings_game, IndustrySpec::enabled, GameSettings::game_creation, HasBit(), GameCreationSettings::landscape, and NEW_INDUSTRYOFFSET.
Referenced by ResetNewGRFData().