OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
15 #include "../cargomonitor.h"
17 #include "../safeguards.h"
40 SB(number, 25, 4,
GB(number, 24, 4));
59 storage.number = iter->first;
60 storage.amount = iter->second;
82 if (fix) storage.number = FixupCargoMonitor(storage.number);
84 std::pair<CargoMonitorID, uint32> p(storage.number, storage.amount);
103 storage.number = iter->first;
104 storage.amount = iter->second;
126 if (fix) storage.number = FixupCargoMonitor(storage.number);
128 std::pair<CargoMonitorID, uint32> p(storage.number, storage.amount);
142 extern const ChunkHandlerTable _cargomonitor_chunk_handlers(cargomonitor_chunk_handlers);
void Load() const override
Load the chunk.
const SaveLoadCompat _cargomonitor_pair_sl_compat[]
Original field order for _cargomonitor_pair_desc.
_cargo_deliveries monitoring map.
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.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
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.
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).
A trimmed down version of what std::span will be in C++20.
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.
CargoMonitorMap _cargo_pickups
Map of monitored pick-ups to the amount since last query/activation.
static bool IsSavegameVersionBefore(SaveLoadVersion major, byte minor=0)
Checks whether the savegame is below major.
void Save() const override
Save the chunk.
Temporary storage of cargo monitoring data for loading or saving it.
void Save() const override
Save the chunk.
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.
_cargo_pickups monitoring map.
static const CMDLChunkHandler CMDL
Chunk definition of the cargomonitoring maps.
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.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void Load() const override
Load the chunk.