OpenTTD Source
20241108-master-g80f628063a
|
Handler for saving/loading an object to/from disk. More...
#include <saveload.h>
Public Member Functions | |
virtual void | Save ([[maybe_unused]] void *object) const |
Save the object to disk. More... | |
virtual void | Load ([[maybe_unused]] void *object) const |
Load the object from disk. More... | |
virtual void | LoadCheck ([[maybe_unused]] void *object) const |
Similar to load, but used only to validate savegames. More... | |
virtual void | FixPointers ([[maybe_unused]] void *object) const |
A post-load callback to fix SL_REF integers into pointers. More... | |
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. More... | |
Data Fields | |
std::optional< std::vector< SaveLoad > > | load_description |
Handler for saving/loading an object to/from disk.
Definition at line 517 of file saveload.h.
|
inlinevirtual |
A post-load callback to fix SL_REF integers into pointers.
object | The object to fix. |
Definition at line 545 of file saveload.h.
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 3288 of file saveload.cpp.
|
inlinevirtual |
Load the object from disk.
object | The object to load. |
Definition at line 533 of file saveload.h.
|
inlinevirtual |
Similar to load, but used only to validate savegames.
object | The object to load. |
Definition at line 539 of file saveload.h.
|
inlinevirtual |
Save the object to disk.
object | The object to store. |
Definition at line 527 of file saveload.h.