117static constexpr CargoTypes ALL_CARGOTYPES{UINT64_MAX};
125 template <
typename T>
128 return std::reduce(this->begin(), this->end(),
T{});
137 return std::ranges::count_if(*
this, [](uint amount) {
return amount != 0; });
static constexpr CargoLabel CT_INVALID
Invalid cargo type.
Label< struct CargoLabelTag > CargoLabel
Globally unique label of a cargo type.
static constexpr CargoLabel CT_PLASTIC
Cargo label for plastic.
static constexpr CargoLabel CT_WATER
Cargo label for water.
static constexpr CargoType INVALID_CARGO
Invalid marker for cargoes.
static constexpr CargoLabel CT_RUBBER
Cargo label for rubber.
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 CargoLabel CT_BUBBLES
Cargo label for bubbles.
EnumBitSet< CargoType, uint64_t > CargoTypes
Bitset of CargoType elements.
static constexpr CargoType NUM_CARGO
Maximum number of cargo types in a game.
static constexpr CargoLabel CT_GRAIN
Cargo label for grain.
static constexpr CargoLabel CT_IRON_ORE
Cargo label for iron ore.
static constexpr CargoLabel CT_COAL
Cargo label for coal.
static constexpr CargoLabel CT_FOOD
Cargo label for food.
static constexpr CargoType NUM_ORIGINAL_CARGO
Original number of cargo types.
static constexpr CargoLabel CT_MAIL
Cargo label for mail.
static constexpr CargoLabel CT_TOYS
Cargo label for toys.
static constexpr CargoLabel CT_WOOD
Cargo label for wood.
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_WHEAT
Cargo label for wheat.
static constexpr CargoLabel CT_CANDY
Cargo label for candies/sweets.
static constexpr CargoLabel CT_GOODS
Cargo label for goods.
static constexpr CargoLabel CT_PASSENGERS
Cargo label for passengers.
static constexpr CargoLabel CT_MAIZE
Cargo label for maize.
static constexpr CargoLabel CT_PAPER
Cargo label for paper.
static constexpr CargoType CARGO_NO_REFIT
Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-renew).
static constexpr CargoLabel CT_LIVESTOCK
Cargo label for livestock.
CargoType
Cargo slots to indicate a cargo type within a game.
static constexpr CargoLabel CT_VALUABLES
Cargo label for valuables.
static constexpr CargoLabel CT_BATTERIES
Cargo label for batteries.
static constexpr CargoLabel CT_TOFFEE
Cargo label for toffee.
static constexpr CargoLabel CT_OIL
Cargo label for oil.
static constexpr CargoLabel CT_GOLD
Cargo label for gold.
static constexpr CargoLabel CT_FRUIT
Cargo label for fruits.
static constexpr CargoLabel CT_SUGAR
Cargo label for sugar.
static constexpr CargoLabel CT_FIZZY_DRINKS
Cargo label for fizzy drinks.
static constexpr CargoLabel CT_DIAMONDS
Cargo label for diamonds.
static constexpr CargoLabel CT_STEEL
Cargo label for steel.
static constexpr CargoLabel CT_COLA
Cargo label for cola.
static constexpr CargoLabel CT_COPPER_ORE
Cargo label for copper ore.
static constexpr CargoLabel CT_COTTON_CANDY
Cargo label for cotton candies.
#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.
A type for 4 character labels/tags/ids in files that should be read/shown as is.
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).
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.
A four character label/tag/id.