OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
10 #ifndef INDUSTRYTYPE_H
11 #define INDUSTRYTYPE_H
83 INDTILE_SPECIAL_NONE = 0,
108 std::array<CargoID, INDUSTRY_NUM_OUTPUTS> produced_cargo;
150 std::array<std::variant<CargoLabel, MixedCargoType>,
INDUSTRY_NUM_INPUTS> accepts_cargo_label;
203 static const uint8_t IT_INVALID = 255;
@ INDUSTRYBEH_ONLY_INTOWN
can only be built in towns (arctic/tropic banks, water tower)
@ CHECK_WATER
Industry should be in the desert.
static const IndustryType NUM_INDUSTRYTYPES
total number of industry types, new and old; limited to 240 because we need some special ids like INV...
static const int INDUSTRY_NUM_OUTPUTS
Number of cargo types an industry can produce.
@ INDUSTRYBEH_CARGOTYPES_UNLIMITED
Allow produced/accepted cargoes callbacks to supply more than 2 and 3 types.
bool UsesOriginalEconomy() const
Determines whether this industrytype uses standard/newgrf production changes.
@ INDUSTRYBEH_AFTER_1960
can only be built after 1960 (oil rigs)
@ INDUSTRYBEH_NO_PAX_PROD_CLAMP
Do not clamp production of passengers. (smooth economy only)
IndustryConstructionType
How was the industry created.
@ CHECK_FOREST
Industry should be build above snow-line in arctic climate.
Money GetRemovalCost() const
Get the cost for removing this industry Take note that the cost will always be zero for non-grf indus...
static const int INDUSTRY_NUM_INPUTS
Number of cargo types an industry can accept.
Money GetConstructionCost() const
Get the cost for constructing this industry.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
uint8_t anim_production
Animation frame to start when goods are produced.
bool anim_state
When true, the tile has to be drawn using the animation state instead of the construction state.
@ INDUSTRYBEH_CAN_SUBSIDENCE
can cause a subsidence (coal mine, shaft that collapses)
Information about animation.
@ INDUSTRYBEH_DONT_INCR_PROD
do not increase production (oil wells) in the temperate climate
uint8_t anim_next
Next frame in an animation.
std::array< int8_t, INDUSTRY_NUM_INPUTS > acceptance
Level of acceptance per cargo type (signed, may be negative!)
uint8_t callback_mask
Bitmask of industry tile callbacks that have to be called.
@ CHECK_BUBBLEGEN
Industry should be in low land.
uint8_t appear_creation[NUM_LANDSCAPE]
Probability of appearance during map creation.
@ INDTILE_SPECIAL_NEXTFRAME_RANDOMBITS
Callback 0x26 needs random bits.
StringID station_name
Default name for nearby station.
std::array< CargoID, INDUSTRY_NUM_INPUTS > accepts_cargo
Cargo accepted by this tile.
uint8_t cost_multiplier
Base construction cost multiplier.
uint8_t minimal_cargo
minimum amount of cargo transported to the stations.
@ INDUSTRYBEH_NOBUILT_MAPCREATION
Do not force one instance of this type to appear on map generation.
uint8_t map_colour
colour used for the small map
std::vector< IndustryTileLayoutTile > IndustryTileLayout
A complete tile layout for an industry is a list of tiles.
@ INDUSTRYBEH_PLANT_ON_BUILT
Fields are planted around when built (all farms)
StringID closure_text
Message appearing when the industry closes.
@ INDUSTRYBEH_AIRPLANE_ATTACKS
can be exploded by a military airplane (oil refinery)
IndustryTileSpecialFlags special_flags
Bitmask of extra flags used by the tile.
uint16_t override
id of the entity been replaced by
@ INDUSTRYBEH_AI_AIRSHIP_ROUTES
ai will attempt to establish air/ship routes to this industry (oil rig)
@ CHECK_END
End marker of the industry check procedures.
bool IsRawIndustry() const
Is an industry with the spec a raw industry?
IndustryType conflicting[3]
Industries this industry cannot be close to.
@ INDUSTRYBEH_PLANT_FIELDS
periodically plants fields around itself (temp and arctic farms)
uint8_t appear_ingame[NUM_LANDSCAPE]
Probability of appearance in game.
std::vector< IndustryTileLayout > layouts
List of possible tile layouts for the industry.
static const IndustryGfx INVALID_INDUSTRYTILE
one above amount is considered invalid
Data related to the handling of grf files.
@ INDUSTRYBEH_BUILT_ONWATER
is built on water (oil rig)
StringID production_up_text
Message appearing when the industry's production is increasing.
Slope slopes_refused
slope pattern on which this tile cannot be built
@ ICT_UNKNOWN
in previous game version or without newindustries activated
@ INDUSTRYBEH_PRODCALLBACK_RANDOM
Production callback needs random bits in var 10.
bool enabled
entity still available (by default true).newgrf can disable it, though
@ INDUSTRYBEH_BEFORE_1950
can only be built before 1950 (oil wells)
uint32_t prospecting_chance
Chance prospecting succeeds.
static const IndustryGfx NUM_INDUSTRYTILES
total number of industry tiles, new and old
@ INDUSTRYLIFE_BLACK_HOLE
Like power plants and banks.
@ CHECK_FARM
Industry should be below snow-line in arctic.
Defines the data structure for constructing industry.
GRFFileProps grf_prop
properties related to the grf file
@ ICT_MAP_GENERATION
during random map creation
uint16_t callback_mask
Bitmask of industry callbacks that have to be called.
A pair-construct of a TileIndexDiff.
@ INDUSTRYLIFE_PROCESSING
Like factories.
bool enabled
entity still available (by default true).newgrf can disable it, though
bool IsProcessingIndustry() const
Is an industry with the spec a processing industry?
std::vector< uint8_t > random_sounds
Random sounds;.
@ CHECK_OIL_RIG
Industries at sea should be positioned near edge of the map.
uint32_t removal_cost_multiplier
Base removal cost multiplier.
uint8_t check_proc
Index to a procedure to check for conflicting circumstances.
@ CHECK_LUMBERMILL
Industry should be in the rain forest.
@ INDUSTRYBEH_ONLY_NEARTOWN
is always built near towns (toy shop)
Slope
Enumeration for the slope-type.
AnimationInfo animation
Information about the animation (is it looping, how many loops etc)
@ INDUSTRYBEH_PROD_MULTI_HNDLING
Automatic production multiplier handling.
@ ICT_SCENARIO_EDITOR
while editing a scenario
void ResetIndustries()
This function initialize the spec arrays of both industry and industry tiles.
@ INDUSTRYLIFE_ORGANIC
Like forests.
StringID production_down_text
Message appearing when the industry's production is decreasing.
GRFFileProps grf_prop
properties related to the grf file
Definition of one tile in an industry tile layout.
@ CHECK_NOTHING
Always succeeds.
IndustryLifeType life_type
This is also known as Industry production flag, in newgrf specs.
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
const IndustrySpec * GetIndustrySpec(IndustryType thistype)
Array of industries data.
IndustryBehaviour behaviour
How this industry will behave, and how others entities can use it.
@ INDUSTRYBEH_CANCLOSE_LASTINSTANCE
Allow closing down the last instance of this type.
@ INDUSTRYBEH_CHOPPER_ATTACKS
can be exploded by a military helicopter (factory)
@ INDUSTRYBEH_TOWN1200_MORE
can only be built in towns larger than 1200 inhabitants (temperate bank)
IndustryTileSpecialFlags
Flags for miscellaneous industry tile specialities.
std::array< CargoID, INDUSTRY_NUM_INPUTS > accepts_cargo
16 accepted cargoes.
void SortIndustryTypes()
Initialize the list of sorted industry types.
StringID name
Displayed name of the industry.
IndustryBehaviour
Various industry behaviours mostly to represent original TTD specialities.
StringID new_industry_text
Message appearing when the industry is built.
const IndustryTileSpec * GetIndustryTileSpec(IndustryGfx gfx)
Array of industry tiles data.
std::array< IndustryType, NUM_INDUSTRYTYPES > _sorted_industry_types
Industry types sorted by name.
@ INDUSTRYBEH_CUT_TREES
cuts trees and produce first output cargo from them (lumber mill)
Defines the data structure of each individual tile of an industry.
@ CHECK_PLANTATION
Industry should NOT be in the desert.
CheckProc
Available procedures to check whether an industry may build at a given location.
uint16_t input_cargo_multiplier[INDUSTRY_NUM_INPUTS][INDUSTRY_NUM_OUTPUTS]
Input cargo multipliers (multiply amount of incoming cargo for the produced cargoes)
uint8_t climate_availability
Bitmask, giving landscape enums as bit position.
@ CHECK_REFINERY
Industry should be positioned near edge of the map.
IndustryGfx GetTranslatedIndustryTileID(IndustryGfx gfx)
Do industry gfx ID translation for NewGRFs.
IndustryLifeType
Available types of industry lifetimes.
@ INDTILE_SPECIAL_ACCEPTS_ALL_CARGO
Tile always accepts all cargoes the associated industry accepts.
@ ICT_NORMAL_GAMEPLAY
either by user or random creation process
@ INDUSTRYLIFE_EXTRACTIVE
Like mines.