OpenTTD Source 20241224-master-gf74b0cf984
|
Types related to cargoes... More...
Go to the source code of this file.
Data Structures | |
struct | CargoArray |
Class for storing amounts of cargo. More... | |
Namespaces | |
namespace | CargoFilterCriteria |
Special cargo filter criteria. | |
Typedefs | |
using | CargoLabel = StrongType::Typedef< uint32_t, struct CargoLabelTag, StrongType::Compare > |
Globally unique label of a cargo type. | |
using | CargoID = uint8_t |
Cargo slots to indicate a cargo type within a game. | |
typedef uint64_t | CargoTypes |
typedef uint16_t | SourceID |
Contains either industry ID, town ID or company ID (or INVALID_SOURCE) | |
Enumerations | |
enum | MixedCargoType { MCT_LIVESTOCK_FRUIT , MCT_GRAIN_WHEAT_MAIZE , MCT_VALUABLES_GOLD_DIAMONDS } |
Mixed cargo types for definitions with cargo that can vary depending on climate. More... | |
enum class | SourceType : uint8_t { Industry , Town , Headquarters } |
Types of cargo source and destination. More... | |
Functions | |
bool | IsValidCargoType (CargoLabel t) |
Test whether cargo type is not CT_INVALID. | |
bool | IsValidCargoID (CargoID t) |
Test whether cargo type is not INVALID_CARGO. | |
Variables | |
static constexpr CargoLabel | CT_PASSENGERS = CargoLabel{'PASS'} |
Available types of cargo Labels may be re-used between different climates. | |
static constexpr CargoLabel | CT_COAL = CargoLabel{'COAL'} |
static constexpr CargoLabel | CT_MAIL = CargoLabel{'MAIL'} |
static constexpr CargoLabel | CT_OIL = CargoLabel{'OIL_'} |
static constexpr CargoLabel | CT_LIVESTOCK = CargoLabel{'LVST'} |
static constexpr CargoLabel | CT_GOODS = CargoLabel{'GOOD'} |
static constexpr CargoLabel | CT_GRAIN = CargoLabel{'GRAI'} |
static constexpr CargoLabel | CT_WOOD = CargoLabel{'WOOD'} |
static constexpr CargoLabel | CT_IRON_ORE = CargoLabel{'IORE'} |
static constexpr CargoLabel | CT_STEEL = CargoLabel{'STEL'} |
static constexpr CargoLabel | CT_VALUABLES = CargoLabel{'VALU'} |
static constexpr CargoLabel | CT_WHEAT = CargoLabel{'WHEA'} |
static constexpr CargoLabel | CT_PAPER = CargoLabel{'PAPR'} |
static constexpr CargoLabel | CT_GOLD = CargoLabel{'GOLD'} |
static constexpr CargoLabel | CT_FOOD = CargoLabel{'FOOD'} |
static constexpr CargoLabel | CT_RUBBER = CargoLabel{'RUBR'} |
static constexpr CargoLabel | CT_FRUIT = CargoLabel{'FRUT'} |
static constexpr CargoLabel | CT_MAIZE = CargoLabel{'MAIZ'} |
static constexpr CargoLabel | CT_COPPER_ORE = CargoLabel{'CORE'} |
static constexpr CargoLabel | CT_WATER = CargoLabel{'WATR'} |
static constexpr CargoLabel | CT_DIAMONDS = CargoLabel{'DIAM'} |
static constexpr CargoLabel | CT_SUGAR = CargoLabel{'SUGR'} |
static constexpr CargoLabel | CT_TOYS = CargoLabel{'TOYS'} |
static constexpr CargoLabel | CT_BATTERIES = CargoLabel{'BATT'} |
static constexpr CargoLabel | CT_CANDY = CargoLabel{'SWET'} |
static constexpr CargoLabel | CT_TOFFEE = CargoLabel{'TOFF'} |
static constexpr CargoLabel | CT_COLA = CargoLabel{'COLA'} |
static constexpr CargoLabel | CT_COTTON_CANDY = CargoLabel{'CTCD'} |
static constexpr CargoLabel | CT_BUBBLES = CargoLabel{'BUBL'} |
static constexpr CargoLabel | CT_PLASTIC = CargoLabel{'PLST'} |
static constexpr CargoLabel | CT_FIZZY_DRINKS = CargoLabel{'FZDR'} |
static constexpr CargoLabel | CT_NONE = CT_PASSENGERS |
Dummy label for engines that carry no cargo; they actually carry 0 passengers. | |
static constexpr CargoLabel | CT_INVALID = CargoLabel{UINT32_MAX} |
Invalid cargo type. | |
static const CargoID | NUM_ORIGINAL_CARGO = 12 |
Original number of cargo types. | |
static const CargoID | NUM_CARGO = 64 |
Maximum number of cargo types in a game. | |
static const CargoID | CARGO_AUTO_REFIT = 0xFD |
Automatically choose cargo type when doing auto refitting. | |
static const CargoID | CARGO_NO_REFIT = 0xFE |
Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-renew). | |
static const CargoID | INVALID_CARGO = UINT8_MAX |
static constexpr CargoID | CargoFilterCriteria::CF_ANY = NUM_CARGO |
Show all items independent of carried cargo (i.e. no filtering) | |
static constexpr CargoID | CargoFilterCriteria::CF_NONE = NUM_CARGO + 1 |
Show only items which do not carry cargo (e.g. train engines) | |
static constexpr CargoID | CargoFilterCriteria::CF_ENGINES = NUM_CARGO + 2 |
Show only engines (for rail vehicles only) | |
static constexpr CargoID | CargoFilterCriteria::CF_FREIGHT = NUM_CARGO + 3 |
Show only vehicles which carry any freight (non-passenger) cargo. | |
static constexpr CargoID | CargoFilterCriteria::CF_NO_RATING = NUM_CARGO + 4 |
Show items with no rating (station list) | |
static constexpr CargoID | CargoFilterCriteria::CF_SELECT_ALL = NUM_CARGO + 5 |
Select all items (station list) | |
static constexpr CargoID | CargoFilterCriteria::CF_EXPAND_LIST = NUM_CARGO + 6 |
Expand list to show all items (station list) | |
static const CargoTypes | ALL_CARGOTYPES = (CargoTypes)UINT64_MAX |
static const SourceID | INVALID_SOURCE = 0xFFFF |
Invalid/unknown index of source. | |
Types related to cargoes...
Definition in file cargo_type.h.
using CargoID = uint8_t |
Cargo slots to indicate a cargo type within a game.
Definition at line 22 of file cargo_type.h.
using CargoLabel = StrongType::Typedef<uint32_t, struct CargoLabelTag, StrongType::Compare> |
Globally unique label of a cargo type.
Definition at line 17 of file cargo_type.h.
typedef uint64_t CargoTypes |
Definition at line 109 of file cargo_type.h.
typedef uint16_t SourceID |
Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
Definition at line 143 of file cargo_type.h.
enum MixedCargoType |
Mixed cargo types for definitions with cargo that can vary depending on climate.
Enumerator | |
---|---|
MCT_LIVESTOCK_FRUIT | Cargo can be livestock or fruit. |
MCT_GRAIN_WHEAT_MAIZE | Cargo can be grain, wheat or maize. |
MCT_VALUABLES_GOLD_DIAMONDS | Cargo can be valuables, gold or diamonds. |
Definition at line 83 of file cargo_type.h.
|
strong |
Types of cargo source and destination.
Enumerator | |
---|---|
Industry | Source/destination is an industry. |
Town | Source/destination is a town. |
Headquarters | Source/destination are company headquarters. |
Definition at line 137 of file cargo_type.h.
|
inline |
Test whether cargo type is not INVALID_CARGO.
Definition at line 107 of file cargo_type.h.
Referenced by AddAcceptedCargoSetMask(), AddArticulatedParts(), AfterLoadGame(), AircraftVehicleChangeInfo(), BuildReplacementVehicle(), CalculateRefitMasks(), CanCargoServiceIndustry(), Engine::CanCarryCargo(), ChangeIndustryProduction(), ChopLumberMillTrees(), CmdBuildAircraft(), CmdBuildRailVehicle(), CmdBuildRailWagon(), CmdBuildRoadVehicle(), CmdBuildShip(), CmdBuildVehicle(), CmdCloneVehicle(), CMSAMine(), CargoesField::ConnectCargo(), Engine::DetermineCapacity(), DoCreateNewIndustry(), CargoesField::Draw(), DrawCargoIconOverlay(), IndustryViewWindow::DrawInfo(), NewGRFInspectWindow::DrawMainPanelWidget(), IndustryProductionGraphWindow::DrawWidget(), FinaliseHouseArray(), FinaliseIndustriesArray(), FindSubsidyIndustryCargoRoute(), FormatString(), GetAllCargoSuffixes(), GetCapacityOfArticulatedParts(), Industry::GetCargoAccepted(), Industry::GetCargoAccepted(), Industry::GetCargoProduced(), Industry::GetCargoProduced(), GetCargoSuffix(), GetCargoSummaryOfArticulatedVehicle(), IndustryDirectoryWindow::GetCargoTransportedPercentsIfValid(), GetCargoTypesOfArticulatedParts(), GetCargoTypesOfArticulatedVehicle(), GetEngineLiveryScheme(), IndustryDirectoryWindow::GetIndustryString(), GetNewCargoTypeForReplace(), GetProductionAroundTiles(), VehicleScopeResolver::GetVariable(), HouseScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), TownScopeResolver::GetVariable(), GetVehicleDefaultCapacity(), IndustryCargoesWindow::HasCommonValidCargo(), IndustryCargoesWindow::HousesCanAccept(), IndustryCargoesWindow::HousesCanSupply(), IndustryProductionCallback(), IndustryDirectoryWindow::IndustryProductionSorter(), Industry::IsCargoAccepted(), Industry::IsCargoProduced(), IsEngineRefittable(), CargoesField::MakeCargo(), BuildIndustryWindow::MakeCargoListString(), Vehicle::NeedsServicing(), IndustryProductionGraphWindow::OnClick(), IndustryViewWindow::OnClick(), IndustryCargoesWindow::OnClick(), IndustryCargoesWindow::OnInit(), IndustryCargoesWindow::OnTooltip(), ProduceIndustryGoodsHelper(), RailVehicleChangeInfo(), RefitVehicle(), RoadVehicleChangeInfo(), ShipVehicleChangeInfo(), TileLoop_Town(), TownHouseChangeInfo(), TrainDetailsCapacityTab(), TrainDetailsCargoTab(), TranslateRefitMask(), TransportIndustryGoods(), TriggerIndustryProduction(), TriggerRoadStopRandomisation(), TriggerStationRandomisation(), UpdateIndustryStatistics(), IndustryProductionGraphWindow::UpdateStatistics(), and IndustryProductionGraphWindow::UpdateWidgetSize().
|
inline |
Test whether cargo type is not CT_INVALID.
Definition at line 105 of file cargo_type.h.
References CT_INVALID.
|
static |
Definition at line 111 of file cargo_type.h.
|
static |
Automatically choose cargo type when doing auto refitting.
Definition at line 77 of file cargo_type.h.
Referenced by CmdOrderRefit(), HandleStationRefit(), Order::IsAutoRefit(), Order::IsRefit(), LoadUnloadVehicle(), and OrdersWindow::OrderClick_Refit().
|
static |
Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-renew).
Definition at line 78 of file cargo_type.h.
Referenced by AfterLoadGame(), BuildReplacementVehicle(), CmdInsertOrder(), CmdModifyOrder(), CmdOrderRefit(), GetNewCargoTypeForReplace(), and OrdersWindow::OrderClick_Refit().
|
staticconstexpr |
Definition at line 59 of file cargo_type.h.
|
staticconstexpr |
Definition at line 64 of file cargo_type.h.
|
staticconstexpr |
Definition at line 60 of file cargo_type.h.
|
staticconstexpr |
Definition at line 31 of file cargo_type.h.
|
staticconstexpr |
Definition at line 62 of file cargo_type.h.
|
staticconstexpr |
Definition at line 52 of file cargo_type.h.
|
staticconstexpr |
Definition at line 63 of file cargo_type.h.
|
staticconstexpr |
Definition at line 54 of file cargo_type.h.
|
staticconstexpr |
Definition at line 66 of file cargo_type.h.
|
staticconstexpr |
Definition at line 46 of file cargo_type.h.
|
staticconstexpr |
Definition at line 50 of file cargo_type.h.
|
staticconstexpr |
Definition at line 45 of file cargo_type.h.
|
staticconstexpr |
Definition at line 35 of file cargo_type.h.
|
staticconstexpr |
Definition at line 36 of file cargo_type.h.
|
staticconstexpr |
Invalid cargo type.
Definition at line 71 of file cargo_type.h.
Referenced by CalculateRefitMasks(), GetActiveCargoLabel(), IndustriesChangeInfo(), IndustrytilesChangeInfo(), IsValidCargoType(), RailVehicleChangeInfo(), RoadVehicleChangeInfo(), ShipVehicleChangeInfo(), and TownHouseChangeInfo().
|
staticconstexpr |
Definition at line 38 of file cargo_type.h.
|
staticconstexpr |
Definition at line 34 of file cargo_type.h.
|
staticconstexpr |
Definition at line 32 of file cargo_type.h.
|
staticconstexpr |
Definition at line 51 of file cargo_type.h.
|
staticconstexpr |
Dummy label for engines that carry no cargo; they actually carry 0 passengers.
Definition at line 69 of file cargo_type.h.
|
staticconstexpr |
Definition at line 33 of file cargo_type.h.
|
staticconstexpr |
Definition at line 44 of file cargo_type.h.
|
staticconstexpr |
Available types of cargo Labels may be re-used between different climates.
Definition at line 30 of file cargo_type.h.
Referenced by CalculateRefitMasks(), ChangeIndustryProduction(), Engine::DetermineCapacity(), and TownScopeResolver::GetVariable().
|
staticconstexpr |
Definition at line 65 of file cargo_type.h.
|
staticconstexpr |
Definition at line 49 of file cargo_type.h.
|
staticconstexpr |
Definition at line 39 of file cargo_type.h.
|
staticconstexpr |
Definition at line 57 of file cargo_type.h.
|
staticconstexpr |
Definition at line 61 of file cargo_type.h.
|
staticconstexpr |
Definition at line 58 of file cargo_type.h.
|
staticconstexpr |
Definition at line 40 of file cargo_type.h.
|
staticconstexpr |
Definition at line 53 of file cargo_type.h.
|
staticconstexpr |
Definition at line 43 of file cargo_type.h.
|
staticconstexpr |
Definition at line 37 of file cargo_type.h.
|
static |
Definition at line 80 of file cargo_type.h.
|
static |
Invalid/unknown index of source.
Definition at line 144 of file cargo_type.h.
Referenced by AddCargoDelivery(), CargoPacket::CargoPacket(), CheckSubsidised(), and CargoPacket::InvalidateAllFrom().
|
static |
Maximum number of cargo types in a game.
Definition at line 74 of file cargo_type.h.
Referenced by StationViewWindow::BuildCargoList(), CompanyStationsWindow::BuildStationsList(), CalculateRefitMasks(), CargoChangeInfo(), CheckConsistencyOfArticulatedVehicle(), CmdBuildVehicle(), CmdCreateSubsidy(), CmdOrderRefit(), CmdRefitVehicle(), DeleteStaleLinks(), BaseGraphWindow::DrawGraph(), DrawStationCoverageAreaText(), FindSubsidyTownCargoRoute(), SlStationGoods::GetNumCargo(), SlTownSupplied::GetNumCargo(), Order::IsRefit(), LinkRefresher::LinkRefresher(), CAPRChunkHandler::Load(), CompanyStationsWindow::OnDropdownSelect(), StationViewWindow::OnInvalidateData(), DepotWindow::OnRightClick(), ParamSet(), LinkRefresher::RefreshLinks(), LinkRefresher::RefreshStats(), RemapNewGRFStringControlCode(), BuildVehicleWindow::SetCargoFilterArray(), TransferCargo(), TriggerWatchedCargoCallbacks(), UpdateStationAcceptance(), and Station::~Station().
|
static |
Original number of cargo types.
Definition at line 73 of file cargo_type.h.