35static constexpr CargoLabel CT_LIVESTOCK{
'LVST'};
39static constexpr CargoLabel CT_IRON_ORE{
'IORE'};
41static constexpr CargoLabel CT_VALUABLES{
'VALU'};
53static constexpr CargoLabel CT_COPPER_ORE{
'CORE'};
55static constexpr CargoLabel CT_DIAMONDS{
'DIAM'};
60static constexpr CargoLabel CT_BATTERIES{
'BATT'};
64static constexpr CargoLabel CT_COTTON_CANDY{
'CTCD'};
67static constexpr CargoLabel CT_FIZZY_DRINKS{
'FZDR'};
81static constexpr CargoType INVALID_CARGO{UINT8_MAX};
114static constexpr CargoTypes ALL_CARGOTYPES{UINT64_MAX};
122 template <
typename T>
125 return std::reduce(this->begin(), this->end(),
T{});
134 return std::ranges::count_if(*
this, [](uint amount) {
return amount != 0; });
static constexpr CargoLabel CT_INVALID
Invalid cargo type.
bool IsValidCargoType(CargoType cargo)
Test whether cargo type is not INVALID_CARGO.
static constexpr CargoType CARGO_AUTO_REFIT
Automatically choose cargo type when doing auto refitting.
static constexpr CargoLabel CT_NONE
Dummy label for engines that carry no cargo; they actually carry 0 passengers.
static constexpr CargoType NUM_CARGO
Maximum number of cargo types in a game.
static constexpr CargoType NUM_ORIGINAL_CARGO
Original number of cargo types.
MixedCargoType
Mixed cargo types for definitions with cargo that can vary depending on climate.
@ MCT_GRAIN_WHEAT_MAIZE
Cargo can be grain, wheat or maize.
@ MCT_LIVESTOCK_FRUIT
Cargo can be livestock or fruit.
@ MCT_VALUABLES_GOLD_DIAMONDS
Cargo can be valuables, gold or diamonds.
static constexpr CargoLabel CT_PASSENGERS
Available types of cargo Labels may be re-used between different climates.
static constexpr CargoType CARGO_NO_REFIT
Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-renew).
StrongType::Typedef< uint32_t, struct CargoLabelTag, StrongType::Compare > CargoLabel
Globally unique label of a cargo type.
CargoType
Cargo slots to indicate a cargo type within a game.
#define T
Climate temperate.
Type (helpers) for enums.
#define DECLARE_INCREMENT_DECREMENT_OPERATORS(enum_type)
For some enums it is useful to have pre/post increment/decrement operators.
Special cargo filter criteria.
static constexpr CargoType CF_FREIGHT
Show only vehicles which carry any freight (non-passenger) cargo.
static constexpr CargoType CF_NONE
Show only items which do not carry cargo (e.g. train engines).
static constexpr CargoType CF_ENGINES
Show only engines (for rail vehicles only).
static constexpr CargoType CF_EXPAND_LIST
Expand list to show all items (station list).
static constexpr CargoType CF_ANY
Show all items independent of carried cargo (i.e. no filtering).
static constexpr CargoType CF_NO_RATING
Show items with no rating (station list).
static constexpr CargoType CF_SELECT_ALL
Select all items (station list).
Type (helpers) for making a strong typedef that is a distinct type.
Class for storing amounts of cargo.
uint GetCount() const
Get the amount of cargos that have an amount.
const T GetSum() const
Get the sum of all cargo amounts.
Templated helper to make a type-safe 'typedef' representing a single POD value.