OpenTTD Source  20240919-master-gdf0233f4c2
IndustrySpec Struct Reference

Defines the data structure for constructing industry. More...

#include <industrytype.h>

Public Member Functions

bool IsRawIndustry () const
 Is an industry with the spec a raw industry? More...
 
bool IsProcessingIndustry () const
 Is an industry with the spec a processing industry? More...
 
Money GetConstructionCost () const
 Get the cost for constructing this industry. More...
 
Money GetRemovalCost () const
 Get the cost for removing this industry Take note that the cost will always be zero for non-grf industries. More...
 
bool UsesOriginalEconomy () const
 Determines whether this industrytype uses standard/newgrf production changes. More...
 

Data Fields

std::vector< IndustryTileLayoutlayouts
 List of possible tile layouts for the industry.
 
uint8_t cost_multiplier
 Base construction cost multiplier.
 
uint32_t removal_cost_multiplier
 Base removal cost multiplier.
 
uint32_t prospecting_chance
 Chance prospecting succeeds.
 
IndustryType conflicting [3]
 Industries this industry cannot be close to.
 
uint8_t check_proc
 Index to a procedure to check for conflicting circumstances.
 
std::array< CargoID, INDUSTRY_NUM_OUTPUTSproduced_cargo
 
std::variant< CargoLabel, MixedCargoTypeproduced_cargo_label [INDUSTRY_NUM_OUTPUTS]
 
uint8_t production_rate [INDUSTRY_NUM_OUTPUTS]
 
uint8_t minimal_cargo
 minimum amount of cargo transported to the stations. More...
 
std::array< CargoID, INDUSTRY_NUM_INPUTSaccepts_cargo
 16 accepted cargoes.
 
std::variant< CargoLabel, MixedCargoTypeaccepts_cargo_label [INDUSTRY_NUM_INPUTS]
 
uint16_t input_cargo_multiplier [INDUSTRY_NUM_INPUTS][INDUSTRY_NUM_OUTPUTS]
 Input cargo multipliers (multiply amount of incoming cargo for the produced cargoes)
 
IndustryLifeType life_type
 This is also known as Industry production flag, in newgrf specs.
 
uint8_t climate_availability
 Bitmask, giving landscape enums as bit position.
 
IndustryBehaviour behaviour
 How this industry will behave, and how others entities can use it.
 
uint8_t map_colour
 colour used for the small map
 
StringID name
 Displayed name of the industry.
 
StringID new_industry_text
 Message appearing when the industry is built.
 
StringID closure_text
 Message appearing when the industry closes.
 
StringID production_up_text
 Message appearing when the industry's production is increasing.
 
StringID production_down_text
 Message appearing when the industry's production is decreasing.
 
StringID station_name
 Default name for nearby station.
 
uint8_t appear_ingame [NUM_LANDSCAPE]
 Probability of appearance in game.
 
uint8_t appear_creation [NUM_LANDSCAPE]
 Probability of appearance during map creation.
 
uint16_t callback_mask
 Bitmask of industry callbacks that have to be called.
 
bool enabled
 entity still available (by default true).newgrf can disable it, though
 
GRFFileProps grf_prop
 properties related to the grf file
 
std::vector< uint8_t > random_sounds
 Random sounds;.
 

Detailed Description

Defines the data structure for constructing industry.

Definition at line 101 of file industrytype.h.

Member Function Documentation

◆ GetConstructionCost()

Money IndustrySpec::GetConstructionCost ( ) const

Get the cost for constructing this industry.

Returns
the cost (inflation corrected etc)

Definition at line 3145 of file industry_cmd.cpp.

◆ GetRemovalCost()

Money IndustrySpec::GetRemovalCost ( ) const

Get the cost for removing this industry Take note that the cost will always be zero for non-grf industries.

Only if the grf author did specified a cost will it be applicable.

Returns
the cost (inflation corrected etc)

Definition at line 3158 of file industry_cmd.cpp.

◆ IsProcessingIndustry()

bool IndustrySpec::IsProcessingIndustry ( ) const

Is an industry with the spec a processing industry?

Returns
true if it should be handled as a processing industry

Definition at line 3134 of file industry_cmd.cpp.

References behaviour, INDUSTRYBEH_CUT_TREES, INDUSTRYLIFE_PROCESSING, and life_type.

◆ IsRawIndustry()

bool IndustrySpec::IsRawIndustry ( ) const

Is an industry with the spec a raw industry?

Returns
true if it should be handled as a raw industry

Definition at line 3125 of file industry_cmd.cpp.

References INDUSTRYLIFE_EXTRACTIVE, INDUSTRYLIFE_ORGANIC, and life_type.

◆ UsesOriginalEconomy()

bool IndustrySpec::UsesOriginalEconomy ( ) const

Determines whether this industrytype uses standard/newgrf production changes.

Returns
true if original economy is used.

Definition at line 3167 of file industry_cmd.cpp.

References _settings_game, GameSettings::economy, and EconomySettings::type.

Referenced by ChangeIndustryProduction(), and Industry::RecomputeProductionMultipliers().

Field Documentation

◆ minimal_cargo

uint8_t IndustrySpec::minimal_cargo

minimum amount of cargo transported to the stations.

If the waiting cargo is less than this number, no cargo is moved to it.

Definition at line 115 of file industrytype.h.

Referenced by TransportIndustryGoods().


The documentation for this struct was generated from the following files: