Go to the documentation of this file.
10 #include "../stdafx.h"
11 #include "../vehicle_base.h"
12 #include "../station_base.h"
16 #include "../safeguards.h"
31 const CargoPacketList *packets = v->cargo.Packets();
72 for (
CargoID c = 0; c <
NUM_CARGO; c++) st->goods[c].cargo.InvalidateCache();
88 static const SaveLoad _cargopacket_desc[] = {
103 return _cargopacket_desc;
112 SlSetArrayIndex(cp->index);
CargoPacketList ::const_iterator ConstIterator
The const iterator for our container.
const SaveLoad * GetCargoPacketDesc()
Wrapper function to get the CargoPacket's internal structure while some of the variables itself are p...
@ SL_MIN_VERSION
First savegame version.
const Tcont * Packets() const
Returns a pointer to the cargo packet list (so you can iterate over it etc).
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.
@ CH_LAST
Last chunk in this array.
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.
#define SLE_CONDNULL(length, from, to)
Empty space in some savegame versions.
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).
static void Save_CAPA()
Save the cargo packets.
#define SLE_END()
End marker of a struct/class save or load.
static bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor=0)
Checks whether the savegame is below major.
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
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.
@ NUM_CARGO
Maximal number of cargo types in a game.
TileIndex xy
Base tile of the station.
const ChunkHandler _cargopacket_chunk_handlers[]
Chunk handlers related to cargo packets.
Container for cargo from the same location and time.
byte CargoID
Cargo slots to indicate a cargo type within a game.
Hand-rolled multimap as map of lists.
static void Load_CAPA()
Load the cargo packets.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.