OpenTTD Source
20240919-master-gdf0233f4c2
|
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);
102 storage.number = iter->first;
103 storage.amount = iter->second;
125 if (fix) storage.number = FixupCargoMonitor(storage.number);
140 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.
void ClearCargoDeliveryMonitoring(CompanyID company)
Clear all delivery cargo monitors.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
static const SaveLoad _cargomonitor_pair_desc[]
Description of the TempStorage structure for the purpose of load and save.
Handlers and description of chunk.
CargoMonitorMap _cargo_pickups
Map of monitored pick-ups to the amount since last query/activation.
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.
@ SLV_FIX_CARGO_MONITOR
207 PR#7175 v1.9 Cargo monitor data packing fix to support 64 cargotypes.
void ClearCargoPickupMonitoring(CompanyID company)
Clear all pick-up cargo monitors.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
_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.
constexpr T SB(T &x, const uint8_t s, const uint8_t n, const U d)
Set n bits in x starting at bit s to d.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
constexpr T ClrBit(T &x, const uint8_t y)
Clears a bit in a variable.
uint32_t CargoMonitorID
Unique number for a company / cargo type / (town or industry).
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void Load() const override
Load the chunk.