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);
#define SLE_CONDNULL(length, from, to)
Empty space in some savegame versions.
static bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor=0)
Checks whether the savegame is below major.
CargoPacket()
Create a new packet for savegame loading.
Maximal number of cargo types in a game.
static void AfterLoad()
Savegame conversion for cargopackets.
static void Save_CAPA()
Save the cargo packets.
Stores station stats for a single cargo.
Tindex index
Index of this pool item.
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.
uint16 count
The amount of cargo in this packet.
SourceType source_type
Type of source_id.
Hand-rolled multimap as map of lists.
Functions/types related to saving and loading games.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
SourceID source_id
Index of source, INVALID_SOURCE if unknown/invalid.
Highest possible saveload version.
Container for cargo from the same location and time.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
Handlers and description of chunk.
#define SLE_END()
End marker of a struct/class save or load.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
const ChunkHandler _cargopacket_chunk_handlers[]
Chunk handlers related to cargo packets.
CargoPacketList ::const_iterator ConstIterator
The const iterator for our container.
TileIndex xy
Base tile of the station.
StationID source
The station where the cargo came from first.
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
static bool IsValidID(size_t index)
Tests whether given index is a valid index for station of this type.
static void Load_CAPA()
Load the cargo packets.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
const Tcont * Packets() const
Returns a pointer to the cargo packet list (so you can iterate over it etc).
friend const struct SaveLoad * GetCargoPacketDesc()
We want this to be saved, right?
Money feeder_share
Value of feeder pickup to be paid for on delivery of cargo.
byte CargoID
Cargo slots to indicate a cargo type within a game.
TileOrStationID loaded_at_xy
Location where this cargo has been loaded into the vehicle.
TileIndex source_xy
The origin of the cargo (first station in feeder chain).
static Station * Get(size_t index)
Gets station with given index.
byte days_in_transit
Amount of days this packet has been in transit.
Last chunk in this array.