Go to the documentation of this file.
63 uint8 transit_days[2];
82 Money current_payment;
153 #define FOR_ALL_CARGOSPECS_FROM(var, start) for (size_t cargospec_index = start; var = nullptr, cargospec_index < CargoSpec::GetArraySize(); cargospec_index++) \
154 if ((var = CargoSpec::Get(cargospec_index))->IsValid())
155 #define FOR_ALL_CARGOSPECS(var) FOR_ALL_CARGOSPECS_FROM(var, 0)
157 #define FOR_EACH_SET_CARGO_ID(var, cargo_bits) FOR_EACH_SET_BIT_EX(CargoID, var, CargoTypes, cargo_bits)
164 #define FOR_ALL_SORTED_CARGOSPECS(var) for (uint8 index = 0; index < _sorted_cargo_specs.size() && (var = _sorted_cargo_specs[index], true) ; index++)
171 #define FOR_ALL_SORTED_STANDARD_CARGOSPECS(var) for (uint8 index = 0; index < _sorted_standard_cargo_specs_size && (var = _sorted_cargo_specs[index], true); index++)
uint32 initial_payment
Initial payment rate before inflation is applied.
@ TE_WATER
Cargo behaves water-like.
static const byte INVALID_CARGO
Constant representing invalid cargo.
@ CC_HAZARDOUS
Hazardous cargo (Nuclear Fuel, Explosives, etc.)
uint8 callback_mask
Bitmask of cargo callbacks that have to be called.
@ CC_COVERED
Covered/Sheltered Freight (Transportation in Box Vans, Silo Wagons, etc.)
CargoLabel label
Unique label of the cargo type.
CargoID GetCargoIDByBitnum(uint8 bitnum)
Find the CargoID of a 'bitnum' value.
TownEffect town_effect
The effect that delivering this cargo type has on towns. Also affects destination of subsidies.
CargoTypes _cargo_mask
Bitmask of cargo types available.
@ CC_NOAVAILABLE
No cargo class has been specified.
@ CC_EXPRESS
Express cargo (Goods, Food, Candy, but also possible for passengers)
@ TE_FOOD
Cargo behaves food/fizzy-drinks-like.
Tindex index
Index of this pool item.
static CargoSpec * Get(size_t index)
Retrieve cargo details for the given cargo ID.
void InitializeSortedCargoSpecs()
Initialize the list of sorted cargo specifications.
@ TE_NONE
Cargo has no effect.
Specification of a cargo type.
@ CC_LIQUID
Liquids (Oil, Water, Rubber)
SpriteID GetCargoIcon() const
Get sprite for showing cargo of this type.
@ CC_PASSENGERS
Passengers.
static size_t GetArraySize()
Total number of cargospecs, both valid and invalid.
uint32 CargoLabel
Globally unique label of a cargo type.
uint8 bitnum
Cargo bit number, is INVALID_CARGO for a non-used spec.
static CargoSpec array[NUM_CARGO]
Array holding all CargoSpecs.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
@ TE_MAIL
Cargo behaves mail-like.
@ TE_PASSENGERS
Cargo behaves passenger-like.
CargoID GetCargoIDByLabel(CargoLabel cl)
Get the cargo ID by cargo label.
uint8 _sorted_standard_cargo_specs_size
Number of standard cargo specifications stored in the _sorted_cargo_specs array.
CargoID Index() const
Determines index of this cargospec.
@ CC_SPECIAL
Special bit used for livery refit tricks instead of normal cargoes.
@ NUM_TE
Amount of town effects.
StringID units_volume
Name of a single unit of cargo of this type.
bool IsValid() const
Tests for validity of this cargospec.
friend void SetupCargoForClimate(LandscapeID l)
Set up the default cargo types for the given landscape type.
@ CC_PIECE_GOODS
Piece goods (Livestock, Wood, Steel, Paper)
@ TE_END
End of town effects.
@ CC_BULK
Bulk cargo (Coal, Grain etc., Ores, Fruit)
uint16 multipliertowngrowth
Size of the effect.
const struct GRFFile * grffile
NewGRF where #group belongs to.
SpriteID sprite
Icon to display this cargo type, may be 0xFFF (which means to resolve an action123 chain).
uint8 weight
Weight of a single unit of this cargo type in 1/16 ton (62.5 kg).
bool is_freight
Cargo type is considered to be freight (affects train freight multiplier).
TownEffect
Town growth effect when delivering cargo.
@ TE_GOODS
Cargo behaves goods/candy-like.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
@ CC_ARMOURED
Armoured cargo (Valuables, Gold, Diamonds)
@ CC_REFRIGERATED
Refrigerated cargo (Food, Fruit)
StringID quantifier
Text for multiple units of cargo of this type.
uint16 classes
Classes of this cargo type.
@ NUM_CARGO
Maximal number of cargo types in a game.
StringID name
Name of this type of cargo.
StringID name_single
Name of a single entity of this type of cargo.
StringID abbrev
Two letter abbreviation for this cargo type.
std::vector< const CargoSpec * > _sorted_cargo_specs
Cargo specifications sorted alphabetically by name.
uint16 multiplier
Capacity multiplier for vehicles. (8 fractional bits)
#define lengthof(x)
Return the length of an fixed size array.
void SetupCargoForClimate(LandscapeID l)
Set up the default cargo types for the given landscape type.
byte CargoID
Cargo slots to indicate a cargo type within a game.
byte LandscapeID
Landscape type.
static bool IsCargoInClass(CargoID c, CargoClass cc)
Does cargo c have cargo class cc?
Dynamic data of a loaded NewGRF.
CargoTypes _standard_cargo_mask
Bitmask of real cargo types available.