12 #include "../stdafx.h" 13 #include "../vehicle_base.h" 14 #include "../station_base.h" 18 #include "../safeguards.h" 48 FOR_ALL_STATIONS(st) {
78 FOR_ALL_STATIONS(st) {
96 static const SaveLoad _cargopacket_desc[] = {
111 return _cargopacket_desc;
122 SlSetArrayIndex(cp->
index);
#define SLE_CONDNULL(length, from, to)
Empty space in some savegame versions.
VehicleCargoList cargo
The cargo this vehicle is carrying.
SourceTypeByte source_type
Type of source_id.
CargoPacket()
Create a new packet for savegame loading.
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.
StationCargoList cargo
The cargo packets of cargo waiting in this station.
GoodsEntry goods[NUM_CARGO]
Goods at this station.
uint16 count
The amount of cargo in this packet.
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.
Container for cargo from the same location and time.
void InvalidateCache()
Invalidates the cached data and rebuild it.
TileIndex tile
Current tile index.
#define SL_MAX_VERSION
Highest possible savegame version.
static bool IsSavegameVersionBefore(uint16 major, byte minor=0)
Checks whether the savegame is below major.
#define FOR_ALL_CARGOPACKETS(var)
Iterate over all valid cargo packets from the begin of the pool.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
Handlers and description of chunk.
Maximal number of cargo types in a game.
#define SLE_END()
End marker of a struct/class save or load.
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.
void KeepAll()
Marks all cargo in the vehicle as to be kept.
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).
#define FOR_ALL_VEHICLES(var)
Iterate over all vehicles.
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.
void InvalidateCache()
Invalidates the cached data and rebuilds it.
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.