OpenTTD Source 20241224-master-gf74b0cf984
|
Handler for saving/loading an object to/from disk. More...
#include <saveload.h>
Public Member Functions | |
virtual void | Save (void *object) const |
Save the object to disk. | |
virtual void | Load (void *object) const |
Load the object from disk. | |
virtual void | LoadCheck (void *object) const |
Similar to load, but used only to validate savegames. | |
virtual void | FixPointers (void *object) const |
A post-load callback to fix SL_REF integers into pointers. | |
virtual SaveLoadTable | GetDescription () const =0 |
Get the description of the fields in the savegame. | |
virtual SaveLoadCompatTable | GetCompatDescription () const =0 |
Get the pre-header description of the fields in the savegame. | |
SaveLoadTable | GetLoadDescription () const |
Get the description for how to load the chunk. | |
Data Fields | |
std::optional< std::vector< SaveLoad > > | load_description |
Handler for saving/loading an object to/from disk.
Definition at line 521 of file saveload.h.
|
inlinevirtual |
A post-load callback to fix SL_REF integers into pointers.
object | The object to fix. |
Reimplemented in DefaultSaveLoadHandler< TImpl, TObject >, DefaultSaveLoadHandler< SlAllowListData, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyLiveries, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAI, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAIBuildRec, CompanyOldAI >, DefaultSaveLoadHandler< SlCompanySettings, CompanyProperties >, DefaultSaveLoadHandler< SlGameLanguageString, LanguageStrings >, DefaultSaveLoadHandler< SlGamelogAction, LoggedAction >, DefaultSaveLoadHandler< SlGamelogEmergency, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfadd, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfbug, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfcompat, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfmove, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfparam, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfrem, LoggedChange >, DefaultSaveLoadHandler< SlGamelogMode, LoggedChange >, DefaultSaveLoadHandler< SlGamelogOldver, LoggedChange >, DefaultSaveLoadHandler< SlGamelogRevision, LoggedChange >, DefaultSaveLoadHandler< SlGamelogSetting, LoggedChange >, DefaultSaveLoadHandler< SlIndustryAccepted, Industry >, DefaultSaveLoadHandler< SlIndustryProduced, Industry >, DefaultSaveLoadHandler< SlIndustryProducedHistory, Industry::ProducedCargo >, DefaultSaveLoadHandler< SlLinkgraphEdge, Node >, DefaultSaveLoadHandler< SlLinkgraphJobProxy, LinkGraphJob >, DefaultSaveLoadHandler< SlLinkgraphNode, LinkGraph >, DefaultSaveLoadHandler< SlRoadStopTileData, BaseStation >, DefaultSaveLoadHandler< SlStationBase, BaseStation >, DefaultSaveLoadHandler< SlStationCargo, GoodsEntry >, DefaultSaveLoadHandler< SlStationFlow, GoodsEntry >, DefaultSaveLoadHandler< SlStationGoods, BaseStation >, DefaultSaveLoadHandler< SlStationNormal, BaseStation >, DefaultSaveLoadHandler< SlStationSpecList< T >, BaseStation >, DefaultSaveLoadHandler< SlStationWaypoint, BaseStation >, DefaultSaveLoadHandler< SlTownAcceptanceMatrix, Town >, DefaultSaveLoadHandler< SlTownReceived, Town >, DefaultSaveLoadHandler< SlTownSupplied, Town >, DefaultSaveLoadHandler< SlVehicleAircraft, Vehicle >, DefaultSaveLoadHandler< SlVehicleCommon, Vehicle >, DefaultSaveLoadHandler< SlVehicleDisaster, Vehicle >, DefaultSaveLoadHandler< SlVehicleEffect, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVehPath, RoadVehicle >, DefaultSaveLoadHandler< SlVehicleShip, Vehicle >, DefaultSaveLoadHandler< SlVehicleShipPath, Ship >, and DefaultSaveLoadHandler< SlVehicleTrain, Vehicle >.
Definition at line 549 of file saveload.h.
|
pure virtual |
Get the pre-header description of the fields in the savegame.
Implemented in SlSkipHandler, DefaultSaveLoadHandler< TImpl, TObject >, DefaultSaveLoadHandler< SlAllowListData, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyLiveries, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAI, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAIBuildRec, CompanyOldAI >, DefaultSaveLoadHandler< SlCompanySettings, CompanyProperties >, DefaultSaveLoadHandler< SlGameLanguageString, LanguageStrings >, DefaultSaveLoadHandler< SlGamelogAction, LoggedAction >, DefaultSaveLoadHandler< SlGamelogEmergency, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfadd, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfbug, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfcompat, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfmove, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfparam, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfrem, LoggedChange >, DefaultSaveLoadHandler< SlGamelogMode, LoggedChange >, DefaultSaveLoadHandler< SlGamelogOldver, LoggedChange >, DefaultSaveLoadHandler< SlGamelogRevision, LoggedChange >, DefaultSaveLoadHandler< SlGamelogSetting, LoggedChange >, DefaultSaveLoadHandler< SlIndustryAccepted, Industry >, DefaultSaveLoadHandler< SlIndustryProduced, Industry >, DefaultSaveLoadHandler< SlIndustryProducedHistory, Industry::ProducedCargo >, DefaultSaveLoadHandler< SlLinkgraphEdge, Node >, DefaultSaveLoadHandler< SlLinkgraphJobProxy, LinkGraphJob >, DefaultSaveLoadHandler< SlLinkgraphNode, LinkGraph >, DefaultSaveLoadHandler< SlRoadStopTileData, BaseStation >, DefaultSaveLoadHandler< SlStationBase, BaseStation >, DefaultSaveLoadHandler< SlStationCargo, GoodsEntry >, DefaultSaveLoadHandler< SlStationFlow, GoodsEntry >, DefaultSaveLoadHandler< SlStationGoods, BaseStation >, DefaultSaveLoadHandler< SlStationNormal, BaseStation >, DefaultSaveLoadHandler< SlStationSpecList< T >, BaseStation >, DefaultSaveLoadHandler< SlStationWaypoint, BaseStation >, DefaultSaveLoadHandler< SlTownAcceptanceMatrix, Town >, DefaultSaveLoadHandler< SlTownReceived, Town >, DefaultSaveLoadHandler< SlTownSupplied, Town >, DefaultSaveLoadHandler< SlVehicleAircraft, Vehicle >, DefaultSaveLoadHandler< SlVehicleCommon, Vehicle >, DefaultSaveLoadHandler< SlVehicleDisaster, Vehicle >, DefaultSaveLoadHandler< SlVehicleEffect, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVehPath, RoadVehicle >, DefaultSaveLoadHandler< SlVehicleShip, Vehicle >, DefaultSaveLoadHandler< SlVehicleShipPath, Ship >, and DefaultSaveLoadHandler< SlVehicleTrain, Vehicle >.
|
pure virtual |
Get the description of the fields in the savegame.
Implemented in SlCompanyOldAIBuildRec, SlLinkgraphJobProxy, SlSkipHandler, DefaultSaveLoadHandler< TImpl, TObject >, DefaultSaveLoadHandler< SlAllowListData, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyLiveries, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAI, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAIBuildRec, CompanyOldAI >, DefaultSaveLoadHandler< SlCompanySettings, CompanyProperties >, DefaultSaveLoadHandler< SlGameLanguageString, LanguageStrings >, DefaultSaveLoadHandler< SlGamelogAction, LoggedAction >, DefaultSaveLoadHandler< SlGamelogEmergency, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfadd, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfbug, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfcompat, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfmove, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfparam, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfrem, LoggedChange >, DefaultSaveLoadHandler< SlGamelogMode, LoggedChange >, DefaultSaveLoadHandler< SlGamelogOldver, LoggedChange >, DefaultSaveLoadHandler< SlGamelogRevision, LoggedChange >, DefaultSaveLoadHandler< SlGamelogSetting, LoggedChange >, DefaultSaveLoadHandler< SlIndustryAccepted, Industry >, DefaultSaveLoadHandler< SlIndustryProduced, Industry >, DefaultSaveLoadHandler< SlIndustryProducedHistory, Industry::ProducedCargo >, DefaultSaveLoadHandler< SlLinkgraphEdge, Node >, DefaultSaveLoadHandler< SlLinkgraphJobProxy, LinkGraphJob >, DefaultSaveLoadHandler< SlLinkgraphNode, LinkGraph >, DefaultSaveLoadHandler< SlRoadStopTileData, BaseStation >, DefaultSaveLoadHandler< SlStationBase, BaseStation >, DefaultSaveLoadHandler< SlStationCargo, GoodsEntry >, DefaultSaveLoadHandler< SlStationFlow, GoodsEntry >, DefaultSaveLoadHandler< SlStationGoods, BaseStation >, DefaultSaveLoadHandler< SlStationNormal, BaseStation >, DefaultSaveLoadHandler< SlStationSpecList< T >, BaseStation >, DefaultSaveLoadHandler< SlStationWaypoint, BaseStation >, DefaultSaveLoadHandler< SlTownAcceptanceMatrix, Town >, DefaultSaveLoadHandler< SlTownReceived, Town >, DefaultSaveLoadHandler< SlTownSupplied, Town >, DefaultSaveLoadHandler< SlVehicleAircraft, Vehicle >, DefaultSaveLoadHandler< SlVehicleCommon, Vehicle >, DefaultSaveLoadHandler< SlVehicleDisaster, Vehicle >, DefaultSaveLoadHandler< SlVehicleEffect, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVehPath, RoadVehicle >, DefaultSaveLoadHandler< SlVehicleShip, Vehicle >, DefaultSaveLoadHandler< SlVehicleShipPath, Ship >, and DefaultSaveLoadHandler< SlVehicleTrain, Vehicle >.
SaveLoadTable SaveLoadHandler::GetLoadDescription | ( | ) | const |
Get the description for how to load the chunk.
Depending on the savegame version this can either use the headers in the savegame or fall back to backwards compatibility and uses hard-coded headers.
Definition at line 3324 of file saveload.cpp.
Referenced by SlSkipHandler::Load().
|
inlinevirtual |
Load the object from disk.
object | The object to load. |
Reimplemented in SlSkipHandler, DefaultSaveLoadHandler< TImpl, TObject >, DefaultSaveLoadHandler< SlAllowListData, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyLiveries, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAI, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAIBuildRec, CompanyOldAI >, DefaultSaveLoadHandler< SlCompanySettings, CompanyProperties >, DefaultSaveLoadHandler< SlGameLanguageString, LanguageStrings >, DefaultSaveLoadHandler< SlGamelogAction, LoggedAction >, DefaultSaveLoadHandler< SlGamelogEmergency, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfadd, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfbug, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfcompat, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfmove, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfparam, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfrem, LoggedChange >, DefaultSaveLoadHandler< SlGamelogMode, LoggedChange >, DefaultSaveLoadHandler< SlGamelogOldver, LoggedChange >, DefaultSaveLoadHandler< SlGamelogRevision, LoggedChange >, DefaultSaveLoadHandler< SlGamelogSetting, LoggedChange >, DefaultSaveLoadHandler< SlIndustryAccepted, Industry >, DefaultSaveLoadHandler< SlIndustryProduced, Industry >, DefaultSaveLoadHandler< SlIndustryProducedHistory, Industry::ProducedCargo >, DefaultSaveLoadHandler< SlLinkgraphEdge, Node >, DefaultSaveLoadHandler< SlLinkgraphJobProxy, LinkGraphJob >, DefaultSaveLoadHandler< SlLinkgraphNode, LinkGraph >, DefaultSaveLoadHandler< SlRoadStopTileData, BaseStation >, DefaultSaveLoadHandler< SlStationBase, BaseStation >, DefaultSaveLoadHandler< SlStationCargo, GoodsEntry >, DefaultSaveLoadHandler< SlStationFlow, GoodsEntry >, DefaultSaveLoadHandler< SlStationGoods, BaseStation >, DefaultSaveLoadHandler< SlStationNormal, BaseStation >, DefaultSaveLoadHandler< SlStationSpecList< T >, BaseStation >, DefaultSaveLoadHandler< SlStationWaypoint, BaseStation >, DefaultSaveLoadHandler< SlTownAcceptanceMatrix, Town >, DefaultSaveLoadHandler< SlTownReceived, Town >, DefaultSaveLoadHandler< SlTownSupplied, Town >, DefaultSaveLoadHandler< SlVehicleAircraft, Vehicle >, DefaultSaveLoadHandler< SlVehicleCommon, Vehicle >, DefaultSaveLoadHandler< SlVehicleDisaster, Vehicle >, DefaultSaveLoadHandler< SlVehicleEffect, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVehPath, RoadVehicle >, DefaultSaveLoadHandler< SlVehicleShip, Vehicle >, DefaultSaveLoadHandler< SlVehicleShipPath, Ship >, and DefaultSaveLoadHandler< SlVehicleTrain, Vehicle >.
Definition at line 537 of file saveload.h.
|
inlinevirtual |
Similar to load, but used only to validate savegames.
object | The object to load. |
Reimplemented in SlSkipHandler, DefaultSaveLoadHandler< TImpl, TObject >, DefaultSaveLoadHandler< SlAllowListData, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyLiveries, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAI, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAIBuildRec, CompanyOldAI >, DefaultSaveLoadHandler< SlCompanySettings, CompanyProperties >, DefaultSaveLoadHandler< SlGameLanguageString, LanguageStrings >, DefaultSaveLoadHandler< SlGamelogAction, LoggedAction >, DefaultSaveLoadHandler< SlGamelogEmergency, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfadd, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfbug, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfcompat, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfmove, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfparam, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfrem, LoggedChange >, DefaultSaveLoadHandler< SlGamelogMode, LoggedChange >, DefaultSaveLoadHandler< SlGamelogOldver, LoggedChange >, DefaultSaveLoadHandler< SlGamelogRevision, LoggedChange >, DefaultSaveLoadHandler< SlGamelogSetting, LoggedChange >, DefaultSaveLoadHandler< SlIndustryAccepted, Industry >, DefaultSaveLoadHandler< SlIndustryProduced, Industry >, DefaultSaveLoadHandler< SlIndustryProducedHistory, Industry::ProducedCargo >, DefaultSaveLoadHandler< SlLinkgraphEdge, Node >, DefaultSaveLoadHandler< SlLinkgraphJobProxy, LinkGraphJob >, DefaultSaveLoadHandler< SlLinkgraphNode, LinkGraph >, DefaultSaveLoadHandler< SlRoadStopTileData, BaseStation >, DefaultSaveLoadHandler< SlStationBase, BaseStation >, DefaultSaveLoadHandler< SlStationCargo, GoodsEntry >, DefaultSaveLoadHandler< SlStationFlow, GoodsEntry >, DefaultSaveLoadHandler< SlStationGoods, BaseStation >, DefaultSaveLoadHandler< SlStationNormal, BaseStation >, DefaultSaveLoadHandler< SlStationSpecList< T >, BaseStation >, DefaultSaveLoadHandler< SlStationWaypoint, BaseStation >, DefaultSaveLoadHandler< SlTownAcceptanceMatrix, Town >, DefaultSaveLoadHandler< SlTownReceived, Town >, DefaultSaveLoadHandler< SlTownSupplied, Town >, DefaultSaveLoadHandler< SlVehicleAircraft, Vehicle >, DefaultSaveLoadHandler< SlVehicleCommon, Vehicle >, DefaultSaveLoadHandler< SlVehicleDisaster, Vehicle >, DefaultSaveLoadHandler< SlVehicleEffect, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVehPath, RoadVehicle >, DefaultSaveLoadHandler< SlVehicleShip, Vehicle >, DefaultSaveLoadHandler< SlVehicleShipPath, Ship >, and DefaultSaveLoadHandler< SlVehicleTrain, Vehicle >.
Definition at line 543 of file saveload.h.
|
inlinevirtual |
Save the object to disk.
object | The object to store. |
Reimplemented in SlSkipHandler, DefaultSaveLoadHandler< TImpl, TObject >, DefaultSaveLoadHandler< SlAllowListData, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyLiveries, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAI, CompanyProperties >, DefaultSaveLoadHandler< SlCompanyOldAIBuildRec, CompanyOldAI >, DefaultSaveLoadHandler< SlCompanySettings, CompanyProperties >, DefaultSaveLoadHandler< SlGameLanguageString, LanguageStrings >, DefaultSaveLoadHandler< SlGamelogAction, LoggedAction >, DefaultSaveLoadHandler< SlGamelogEmergency, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfadd, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfbug, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfcompat, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfmove, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfparam, LoggedChange >, DefaultSaveLoadHandler< SlGamelogGrfrem, LoggedChange >, DefaultSaveLoadHandler< SlGamelogMode, LoggedChange >, DefaultSaveLoadHandler< SlGamelogOldver, LoggedChange >, DefaultSaveLoadHandler< SlGamelogRevision, LoggedChange >, DefaultSaveLoadHandler< SlGamelogSetting, LoggedChange >, DefaultSaveLoadHandler< SlIndustryAccepted, Industry >, DefaultSaveLoadHandler< SlIndustryProduced, Industry >, DefaultSaveLoadHandler< SlIndustryProducedHistory, Industry::ProducedCargo >, DefaultSaveLoadHandler< SlLinkgraphEdge, Node >, DefaultSaveLoadHandler< SlLinkgraphJobProxy, LinkGraphJob >, DefaultSaveLoadHandler< SlLinkgraphNode, LinkGraph >, DefaultSaveLoadHandler< SlRoadStopTileData, BaseStation >, DefaultSaveLoadHandler< SlStationBase, BaseStation >, DefaultSaveLoadHandler< SlStationCargo, GoodsEntry >, DefaultSaveLoadHandler< SlStationFlow, GoodsEntry >, DefaultSaveLoadHandler< SlStationGoods, BaseStation >, DefaultSaveLoadHandler< SlStationNormal, BaseStation >, DefaultSaveLoadHandler< SlStationSpecList< T >, BaseStation >, DefaultSaveLoadHandler< SlStationWaypoint, BaseStation >, DefaultSaveLoadHandler< SlTownAcceptanceMatrix, Town >, DefaultSaveLoadHandler< SlTownReceived, Town >, DefaultSaveLoadHandler< SlTownSupplied, Town >, DefaultSaveLoadHandler< SlVehicleAircraft, Vehicle >, DefaultSaveLoadHandler< SlVehicleCommon, Vehicle >, DefaultSaveLoadHandler< SlVehicleDisaster, Vehicle >, DefaultSaveLoadHandler< SlVehicleEffect, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >, DefaultSaveLoadHandler< SlVehicleRoadVehPath, RoadVehicle >, DefaultSaveLoadHandler< SlVehicleShip, Vehicle >, DefaultSaveLoadHandler< SlVehicleShipPath, Ship >, and DefaultSaveLoadHandler< SlVehicleTrain, Vehicle >.
Definition at line 531 of file saveload.h.
std::optional<std::vector<SaveLoad> > SaveLoadHandler::load_description |
Definition at line 523 of file saveload.h.