OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
15 #include "../vehicle_base.h"
16 #include "../station_base.h"
18 #include "../safeguards.h"
33 const CargoPacketList *packets = v->cargo.Packets();
74 for (
CargoID c = 0; c <
NUM_CARGO; c++) st->goods[c].cargo.InvalidateCache();
90 static const SaveLoad _cargopacket_desc[] = {
100 return _cargopacket_desc;
111 SlSetArrayIndex(cp->index);
134 extern const ChunkHandlerTable _cargopacket_chunk_handlers(cargopacket_chunk_handlers);
CargoPacketList ::const_iterator ConstIterator
The const iterator for our container.
const Tcont * Packets() const
Returns a pointer to the cargo packet list (so you can iterate over it etc).
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
StationID source
The station where the cargo came from first.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
static Station * Get(size_t index)
Gets station with given index.
static bool IsValidID(size_t index)
Tests whether given index is a valid index for station of this type.
Handlers and description of chunk.
TileOrStationID loaded_at_xy
Location where this cargo has been loaded into the vehicle.
static Pool::IterateWrapper< Station > Iterate(size_t from=0)
Returns an iterable ensemble of all valid stations of type T.
StationCargoList cargo
The cargo packets of cargo waiting in this station.
TileIndex source_xy
The origin of the cargo (first station in feeder chain).
A trimmed down version of what std::span will be in C++20.
SaveLoadTable GetCargoPacketDesc()
Wrapper function to get the CargoPacket's internal structure while some of the variables itself are p...
static bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor=0)
Checks whether the savegame is below major.
void Save() const override
Save the chunk.
static void AfterLoad()
Savegame conversion for cargopackets.
@ SL_MAX_VERSION
Highest possible saveload version.
Stores station stats for a single cargo.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
void Load() const override
Load the chunk.
@ NUM_CARGO
Maximal number of cargo types in a game.
TileIndex xy
Base tile of the station.
Container for cargo from the same location and time.
byte CargoID
Cargo slots to indicate a cargo type within a game.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
Hand-rolled multimap as map of lists.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
const SaveLoadCompat _cargopacket_sl_compat[]
Original field order for _cargopacket_desc.