11#include "../script/api/script_object.hpp"
16static const SaveLoad _randomizer_desc[] = {
30 SlSetArrayIndex(owner);
31 SlObject(&ScriptObject::GetRandomizer(owner), _randomizer_desc);
41 SlObject(&ScriptObject::GetRandomizer(index), _randomizer_desc);
51extern const ChunkHandlerTable _randomizer_chunk_handlers(randomizer_chunk_handlers);
static constexpr Owner OWNER_END
Last + 1 owner.
static constexpr Owner OWNER_BEGIN
First owner.
A number of safeguards to prevent using unsafe methods.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
Functions/types related to saving and loading games.
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
@ Table
An Array with a header describing the elements.
Declaration of functions used in more save/load files.
Definition of base types and functions in a cross-platform compatible way.
ChunkHandler(ChunkId id, ChunkType type)
Create this ChunkHandler.
Structure to encapsulate the pseudo random number generators.
void Save() const override
Save the chunk.
void Load() const override
Load the chunk.
static SaveLoad Variable(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a variable in some savegame versions.