OpenTTD Source 20261112-master-gbcbec5e63f
IndustryTileSpec Struct Reference

Defines the data structure of each individual tile of an industry. More...

#include <industrytype.h>

Public Member Functions

constexpr IndustryTileSpec (int8_t ca1, std::variant< CargoLabel, MixedCargoType > c1, int8_t ca2, std::variant< CargoLabel, MixedCargoType > c2, int8_t ca3, std::variant< CargoLabel, MixedCargoType > c3, Slope sl, IndustryGfx a1, IndustryGfx a2, bool a3)
 Creates IndustryTileSpec from the properties of an industry tile.
constexpr IndustryTileSpec (int8_t cargo_acceptance1, std::variant< CargoLabel, MixedCargoType > cargo1, int8_t cargo_acceptance2, std::variant< CargoLabel, MixedCargoType > cargo2, bool is_construction)
 Creates IndustryTileSpec with some default values.

Data Fields

std::array< CargoType, INDUSTRY_NUM_INPUTS > accepts_cargo
 Cargo accepted by this tile.
std::array< int8_t, INDUSTRY_NUM_INPUTS > acceptance
 Level of acceptance per cargo type (signed, may be negative!).
Slope slopes_refused
 slope pattern on which this tile cannot be built
IndustryGfx anim_production
 Animation frame to start when goods are produced.
IndustryGfx anim_next
 Next frame in an animation.
bool anim_state
 When true, the tile has to be drawn using the animation state instead of the construction stage.
IndustryTileCallbackMasks callback_mask {}
 Bitmask of industry tile callbacks that have to be called.
AnimationInfo< IndustryAnimationTriggers > animation {}
 Information about the animation (is it looping, how many loops etc).
IndustryTileSpecialFlags special_flags {}
 Bitmask of extra flags used by the tile.
SubstituteGRFFileProps grf_prop {INVALID_INDUSTRYTILE}
 properties related to the grf file
std::vector< BadgeID > badges {}
 Badge list.
std::array< std::variant< CargoLabel, MixedCargoType >, INDUSTRY_ORIGINAL_NUM_INPUTS > accepts_cargo_label
 Cargo labels of accepted cargo for default industry tiles.

Detailed Description

Defines the data structure of each individual tile of an industry.

Note
A tile can at most accept 3 types of cargo, even if an industry as a whole can accept more types.

Definition at line 158 of file industrytype.h.

Constructor & Destructor Documentation

◆ IndustryTileSpec() [1/2]

IndustryTileSpec::IndustryTileSpec ( int8_t ca1,
std::variant< CargoLabel, MixedCargoType > c1,
int8_t ca2,
std::variant< CargoLabel, MixedCargoType > c2,
int8_t ca3,
std::variant< CargoLabel, MixedCargoType > c3,
Slope sl,
IndustryGfx a1,
IndustryGfx a2,
bool a3 )
inlineconstexpr

Creates IndustryTileSpec from the properties of an industry tile.

Parameters
ca1Acceptance of first cargo.
c1First type of cargo accepted for this tile.
ca2Acceptance of second cargo.
c2Second cargo.
ca3Acceptance of third cargo.
c3Third cargo. Those three are in an array.
slSlope refused upon choosing a place to build.
a1Animation frame on production.
a2Next frame of animation.
a3Chooses between animation or construction stage.

Definition at line 193 of file industrytype.h.

References acceptance, accepts_cargo, accepts_cargo_label, anim_next, anim_production, anim_state, INVALID_CARGO, and slopes_refused.

◆ IndustryTileSpec() [2/2]

IndustryTileSpec::IndustryTileSpec ( int8_t cargo_acceptance1,
std::variant< CargoLabel, MixedCargoType > cargo1,
int8_t cargo_acceptance2,
std::variant< CargoLabel, MixedCargoType > cargo2,
bool is_construction )
inlineconstexpr

Creates IndustryTileSpec with some default values.

Parameters
cargo_acceptance1Acceptance of first cargo.
cargo1First type of cargo accepted for this tile.
cargo_acceptance2Acceptance of second cargo.
cargo2Second cargo.
is_constructionChooses between animation or construction stage.

Definition at line 206 of file industrytype.h.

References CT_INVALID, INDUSTRYTILE_NOANIM, and SLOPE_STEEP.

Field Documentation

◆ acceptance

std::array<int8_t, INDUSTRY_NUM_INPUTS> IndustryTileSpec::acceptance

Level of acceptance per cargo type (signed, may be negative!).

Definition at line 160 of file industrytype.h.

Referenced by AddAcceptedCargo_Industry(), and IndustryTileSpec().

◆ accepts_cargo

std::array<CargoType, INDUSTRY_NUM_INPUTS> IndustryTileSpec::accepts_cargo

Cargo accepted by this tile.

Definition at line 159 of file industrytype.h.

Referenced by AddAcceptedCargo_Industry(), and IndustryTileSpec().

◆ accepts_cargo_label

std::array<std::variant<CargoLabel, MixedCargoType>, INDUSTRY_ORIGINAL_NUM_INPUTS> IndustryTileSpec::accepts_cargo_label

Cargo labels of accepted cargo for default industry tiles.

Definition at line 176 of file industrytype.h.

Referenced by IndustryTileSpec().

◆ anim_next

IndustryGfx IndustryTileSpec::anim_next

Next frame in an animation.

Definition at line 163 of file industrytype.h.

Referenced by IndustryTileSpec(), and TileLoop_Industry().

◆ anim_production

IndustryGfx IndustryTileSpec::anim_production

Animation frame to start when goods are produced.

Definition at line 162 of file industrytype.h.

Referenced by IndustryTileSpec(), and TileLoop_Industry().

◆ anim_state

bool IndustryTileSpec::anim_state

When true, the tile has to be drawn using the animation state instead of the construction stage.

Definition at line 168 of file industrytype.h.

Referenced by DrawTile_Industry(), and IndustryTileSpec().

◆ animation

AnimationInfo<IndustryAnimationTriggers> IndustryTileSpec::animation {}

Information about the animation (is it looping, how many loops etc).

Definition at line 171 of file industrytype.h.

Referenced by DoCreateNewIndustry().

◆ badges

std::vector<BadgeID> IndustryTileSpec::badges {}

Badge list.

Definition at line 174 of file industrytype.h.

Referenced by NIHIndustryTile::GetBadges().

◆ callback_mask

IndustryTileCallbackMasks IndustryTileSpec::callback_mask {}

Bitmask of industry tile callbacks that have to be called.

Definition at line 170 of file industrytype.h.

Referenced by AddAcceptedCargo_Industry(), CheckIfIndustryTileSlopes(), GetFoundation_Industry(), and TerraformTile_Industry().

◆ grf_prop

◆ slopes_refused

Slope IndustryTileSpec::slopes_refused

slope pattern on which this tile cannot be built

Definition at line 161 of file industrytype.h.

Referenced by CheckIfIndustryTilesAreFree(), CheckIfIndustryTileSlopes(), IndustryTileSpec(), and PerformIndustryTileSlopeCheck().

◆ special_flags

IndustryTileSpecialFlags IndustryTileSpec::special_flags {}

Bitmask of extra flags used by the tile.

Definition at line 172 of file industrytype.h.

Referenced by AddAcceptedCargo_Industry().


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