Go to the documentation of this file.
10 #include "../stdafx.h"
11 #include "../cargomonitor.h"
15 #include "../safeguards.h"
39 SB(number, 25, 4,
GB(number, 24, 4));
53 storage.number = iter->first;
54 storage.amount = iter->second;
75 if (fix) storage.number = FixupCargoMonitor(storage.number);
77 std::pair<CargoMonitorID, uint32> p(storage.number, storage.amount);
91 storage.number = iter->first;
92 storage.amount = iter->second;
113 if (fix) storage.number = FixupCargoMonitor(storage.number);
115 std::pair<CargoMonitorID, uint32> p(storage.number, storage.amount);
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
void ClearCargoDeliveryMonitoring(CompanyID company)
Clear all delivery cargo monitors.
static T ClrBit(T &x, const uint8 y)
Clears a bit in a variable.
@ SLV_FIX_CARGO_MONITOR
207 PR#7175 v1.9 Cargo monitor data packing fix to support 64 cargotypes.
@ CH_LAST
Last chunk in this array.
static const SaveLoad _cargomonitor_pair_desc[]
Description of the TempStorage structure for the purpose of load and save.
Handlers and description of chunk.
uint32 CargoMonitorID
Unique number for a company / cargo type / (town or industry).
static void LoadDelivery()
Load the _cargo_deliveries monitoring map.
static T SB(T &x, const uint8 s, const uint8 n, const U d)
Set n bits in x starting at bit s to d.
#define SLE_END()
End marker of a struct/class save or load.
CargoMonitorMap _cargo_pickups
Map of monitored pick-ups to the amount since last query/activation.
static void SaveDelivery()
Save the _cargo_deliveries monitoring map.
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 LoadPickup()
Load the _cargo_pickups monitoring map.
Temporary storage of cargo monitoring data for loading or saving it.
CargoMonitorMap _cargo_deliveries
Map of monitored deliveries to the amount since last query/activation.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
void ClearCargoPickupMonitoring(CompanyID company)
Clear all pick-up cargo monitors.
const ChunkHandler _cargomonitor_chunk_handlers[]
Chunk definition of the cargomonitoring maps.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
static void SavePickup()
Save the _cargo_pickups monitoring map.