80 static const CargoID INVALID_CARGO = UINT8_MAX;
109 typedef uint64_t CargoTypes;
111 static const CargoTypes ALL_CARGOTYPES = (CargoTypes)UINT64_MAX;
119 template <
typename T>
122 return std::reduce(this->begin(), this->end(), T{});
131 return std::count_if(this->begin(), this->end(), [](uint amount) {
return amount != 0; });
static const CargoID CARGO_NO_REFIT
Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-renew).
static constexpr CargoLabel CT_INVALID
Invalid cargo type.
bool IsValidCargoType(CargoLabel t)
Test whether cargo type is not CT_INVALID.
static constexpr CargoLabel CT_NONE
Dummy label for engines that carry no cargo; they actually carry 0 passengers.
uint8_t CargoID
Cargo slots to indicate a cargo type within a game.
bool IsValidCargoID(CargoID t)
Test whether cargo type is not INVALID_CARGO.
static const CargoID NUM_ORIGINAL_CARGO
Original number of cargo types.
uint16_t SourceID
Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
static constexpr CargoLabel CT_PASSENGERS
Available types of cargo Labels may be re-used between different climates.
static const SourceID INVALID_SOURCE
Invalid/unknown index of source.
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 const CargoID NUM_CARGO
Maximum number of cargo types in a game.
SourceType
Types of cargo source and destination.
@ Industry
Source/destination is an industry.
@ Headquarters
Source/destination are company headquarters.
@ Town
Source/destination is a town.
static const CargoID CARGO_AUTO_REFIT
Automatically choose cargo type when doing auto refitting.
Type (helpers) for enums.
Special cargo filter criteria.
static constexpr CargoID CF_NONE
Show only items which do not carry cargo (e.g. train engines)
static constexpr CargoID CF_NO_RATING
Show items with no rating (station list)
static constexpr CargoID CF_ANY
Show all items independent of carried cargo (i.e. no filtering)
static constexpr CargoID CF_FREIGHT
Show only vehicles which carry any freight (non-passenger) cargo.
static constexpr CargoID CF_EXPAND_LIST
Expand list to show all items (station list)
static constexpr CargoID CF_ENGINES
Show only engines (for rail vehicles only)
static constexpr CargoID 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.