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