|
OpenTTD Source
14.0-beta1
|
Go to the documentation of this file.
74 static const CargoID INVALID_CARGO = UINT8_MAX;
92 typedef uint64_t CargoTypes;
94 static const CargoTypes ALL_CARGOTYPES = (CargoTypes)UINT64_MAX;
102 template <
typename T>
105 return std::reduce(this->begin(), this->end(), T{});
114 return std::count_if(this->begin(), this->end(), [](uint amount) {
return amount != 0; });
CargoType
Available types of cargo.
const T GetSum() const
Get the sum of all cargo amounts.
bool IsValidCargoType(CargoType t)
Test whether cargo type is not CT_INVALID.
static const CargoID CARGO_NO_REFIT
Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-renew).
uint GetCount() const
Get the amount of cargos that have an amount.
static constexpr CargoID CF_ENGINES
Show only engines (for rail vehicles only)
Class for storing amounts of cargo.
static constexpr CargoID CF_NONE
Show only items which do not carry cargo (e.g. train engines)
uint16_t SourceID
Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
@ Industry
Source/destination is an industry.
@ Town
Source/destination is a town.
static const CargoID CARGO_AUTO_REFIT
Automatically choose cargo type when doing auto refitting.
SourceType
Types of cargo source and destination.
static const SourceID INVALID_SOURCE
Invalid/unknown index of source.
@ Headquarters
Source/destination are company headquarters.
byte 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.
static const CargoID NUM_CARGO
Maximum number of cargo types in a game.
@ CT_INVALID
Invalid cargo type.
static constexpr CargoID CF_FREIGHT
Show only vehicles which carry any freight (non-passenger) cargo.
Special cargo filter criteria.
static constexpr CargoID CF_ANY
Show all items independent of carried cargo (i.e. no filtering)