OpenTTD Source 20261112-master-gbcbec5e63f
gamelog_sl.cpp
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#include "../stdafx.h"
11
12#include "saveload.h"
13#include "saveload_error.hpp"
15
16#include "../gamelog_internal.h"
17#include "../fios.h"
18#include "../string_func.h"
19
20#include "../safeguards.h"
21
22
23class SlGamelogMode : public DefaultSaveLoadHandler<SlGamelogMode, LoggedChange> {
24public:
25 static inline const SaveLoad description[] = {
28 };
29 static inline const SaveLoadCompatTable compat_description = _gamelog_mode_sl_compat;
30
31 void Save(LoggedChange *lc) const override
32 {
33 if (lc->ct != GamelogChangeType::Mode) return;
34 SlObject(lc, this->GetDescription());
35 }
36
37 void Load(LoggedChange *lc) const override
38 {
39 if (lc->ct != GamelogChangeType::Mode) return;
40 SlObject(lc, this->GetLoadDescription());
41 }
42
43 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
44};
45
46class SlGamelogRevision : public DefaultSaveLoadHandler<SlGamelogRevision, LoggedChange> {
47public:
48 static const size_t GAMELOG_REVISION_LENGTH = 15;
49 static inline std::array<char, GAMELOG_REVISION_LENGTH> revision_text;
50
51 static inline const SaveLoad description[] = {
57 };
58 static inline const SaveLoadCompatTable compat_description = _gamelog_revision_sl_compat;
59
60 void Save(LoggedChange *lc) const override
61 {
62 if (lc->ct != GamelogChangeType::Revision) return;
63 SlObject(lc, this->GetDescription());
64 }
65
66 void Load(LoggedChange *lc) const override
67 {
68 if (lc->ct != GamelogChangeType::Revision) return;
69 SlObject(lc, this->GetLoadDescription());
70
72 static_cast<LoggedChangeRevision *>(lc)->text = StrMakeValid(std::string_view(std::begin(SlGamelogRevision::revision_text), std::end(SlGamelogRevision::revision_text)));
73 }
74 }
75
76 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
77};
78
79class SlGamelogOldver : public DefaultSaveLoadHandler<SlGamelogOldver, LoggedChange> {
80public:
81 static inline const SaveLoad description[] = {
84 };
85 static inline const SaveLoadCompatTable compat_description = _gamelog_oldver_sl_compat;
86
87 void Save(LoggedChange *lc) const override
88 {
89 if (lc->ct != GamelogChangeType::OldVer) return;
90 SlObject(lc, this->GetDescription());
91 }
92
93 void Load(LoggedChange *lc) const override
94 {
95 if (lc->ct != GamelogChangeType::OldVer) return;
96 SlObject(lc, this->GetLoadDescription());
97 }
98
99 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
100};
101
102class SlGamelogSetting : public DefaultSaveLoadHandler<SlGamelogSetting, LoggedChange> {
103public:
104 static inline const SaveLoad description[] = {
108 };
109 static inline const SaveLoadCompatTable compat_description = _gamelog_setting_sl_compat;
110
111 void Save(LoggedChange *lc) const override
112 {
113 if (lc->ct != GamelogChangeType::Setting) return;
114 SlObject(lc, this->GetDescription());
115 }
116
117 void Load(LoggedChange *lc) const override
118 {
119 if (lc->ct != GamelogChangeType::Setting) return;
120 SlObject(lc, this->GetLoadDescription());
121 }
122
123 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
124};
125
126class SlGamelogGrfadd : public DefaultSaveLoadHandler<SlGamelogGrfadd, LoggedChange> {
127public:
128 static inline const SaveLoad description[] = {
131 };
132 static inline const SaveLoadCompatTable compat_description = _gamelog_grfadd_sl_compat;
133
134 void Save(LoggedChange *lc) const override
135 {
136 if (lc->ct != GamelogChangeType::GRFAdd) return;
137 SlObject(lc, this->GetDescription());
138 }
139
140 void Load(LoggedChange *lc) const override
141 {
142 if (lc->ct != GamelogChangeType::GRFAdd) return;
143 SlObject(lc, this->GetLoadDescription());
144 }
145
146 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
147};
148
149class SlGamelogGrfrem : public DefaultSaveLoadHandler<SlGamelogGrfrem, LoggedChange> {
150public:
151 static inline const SaveLoad description[] = {
153 };
154 static inline const SaveLoadCompatTable compat_description = _gamelog_grfrem_sl_compat;
155
156 void Save(LoggedChange *lc) const override
157 {
158 if (lc->ct != GamelogChangeType::GRFRem) return;
159 SlObject(lc, this->GetDescription());
160 }
161
162 void Load(LoggedChange *lc) const override
163 {
164 if (lc->ct != GamelogChangeType::GRFRem) return;
165 SlObject(lc, this->GetLoadDescription());
166 }
167
168 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
169};
170
171class SlGamelogGrfcompat : public DefaultSaveLoadHandler<SlGamelogGrfcompat, LoggedChange> {
172public:
173 static inline const SaveLoad description[] = {
176 };
177 static inline const SaveLoadCompatTable compat_description = _gamelog_grfcompat_sl_compat;
178
179 void Save(LoggedChange *lc) const override
180 {
181 if (lc->ct != GamelogChangeType::GRFCompat) return;
182 SlObject(lc, this->GetDescription());
183 }
184
185 void Load(LoggedChange *lc) const override
186 {
187 if (lc->ct != GamelogChangeType::GRFCompat) return;
188 SlObject(lc, this->GetLoadDescription());
189 }
190
191 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
192};
193
194class SlGamelogGrfparam : public DefaultSaveLoadHandler<SlGamelogGrfparam, LoggedChange> {
195public:
196 static inline const SaveLoad description[] = {
198 };
199 static inline const SaveLoadCompatTable compat_description = _gamelog_grfparam_sl_compat;
200
201 void Save(LoggedChange *lc) const override
202 {
203 if (lc->ct != GamelogChangeType::GRFParam) return;
204 SlObject(lc, this->GetDescription());
205 }
206
207 void Load(LoggedChange *lc) const override
208 {
209 if (lc->ct != GamelogChangeType::GRFParam) return;
210 SlObject(lc, this->GetLoadDescription());
211 }
212
213 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
214};
215
216class SlGamelogGrfmove : public DefaultSaveLoadHandler<SlGamelogGrfmove, LoggedChange> {
217public:
218 static inline const SaveLoad description[] = {
221 };
222 static inline const SaveLoadCompatTable compat_description = _gamelog_grfmove_sl_compat;
223
224 void Save(LoggedChange *lc) const override
225 {
226 if (lc->ct != GamelogChangeType::GRFMove) return;
227 SlObject(lc, this->GetDescription());
228 }
229
230 void Load(LoggedChange *lc) const override
231 {
232 if (lc->ct != GamelogChangeType::GRFMove) return;
233 SlObject(lc, this->GetLoadDescription());
234 }
235
236 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
237};
238
239class SlGamelogGrfbug : public DefaultSaveLoadHandler<SlGamelogGrfbug, LoggedChange> {
240public:
241 static inline const SaveLoad description[] = {
245 };
246 static inline const SaveLoadCompatTable compat_description = _gamelog_grfbug_sl_compat;
247
248 void Save(LoggedChange *lc) const override
249 {
250 if (lc->ct != GamelogChangeType::GRFBug) return;
251 SlObject(lc, this->GetDescription());
252 }
253
254 void Load(LoggedChange *lc) const override
255 {
256 if (lc->ct != GamelogChangeType::GRFBug) return;
257 SlObject(lc, this->GetLoadDescription());
258 }
259
260 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
261};
262
263static bool _is_emergency_save = true;
264
265class SlGamelogEmergency : public DefaultSaveLoadHandler<SlGamelogEmergency, LoggedChange> {
266public:
268 static inline const SaveLoad description[] = {
270 };
271 static inline const SaveLoadCompatTable compat_description = _gamelog_emergency_sl_compat;
272
273 void Save(LoggedChange *lc) const override
274 {
275 if (lc->ct != GamelogChangeType::Emergency) return;
276
277 _is_emergency_save = true;
278 SlObject(lc, this->GetDescription());
279 }
280
281 void Load(LoggedChange *lc) const override
282 {
283 if (lc->ct != GamelogChangeType::Emergency) return;
284
285 SlObject(lc, this->GetLoadDescription());
286 }
287
288 void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
289};
290
291static std::unique_ptr<LoggedChange> MakeLoggedChange(GamelogChangeType type)
292{
293 switch (type) {
294 case GamelogChangeType::Mode: return std::make_unique<LoggedChangeMode>();
295 case GamelogChangeType::Revision: return std::make_unique<LoggedChangeRevision>();
296 case GamelogChangeType::OldVer: return std::make_unique<LoggedChangeOldVersion>();
297 case GamelogChangeType::Setting: return std::make_unique<LoggedChangeSettingChanged>();
298 case GamelogChangeType::GRFAdd: return std::make_unique<LoggedChangeGRFAdd>();
299 case GamelogChangeType::GRFRem: return std::make_unique<LoggedChangeGRFRemoved>();
300 case GamelogChangeType::GRFCompat: return std::make_unique<LoggedChangeGRFChanged>();
301 case GamelogChangeType::GRFParam: return std::make_unique<LoggedChangeGRFParameterChanged>();
302 case GamelogChangeType::GRFMove: return std::make_unique<LoggedChangeGRFMoved>();
303 case GamelogChangeType::GRFBug: return std::make_unique<LoggedChangeGRFBug>();
304 case GamelogChangeType::Emergency: return std::make_unique<LoggedChangeEmergencySave>();
307 default:
308 SlErrorCorrupt("Invalid gamelog action type");
309 }
310}
311
312class SlGamelogAction : public DefaultSaveLoadHandler<SlGamelogAction, LoggedAction> {
313public:
314 static inline const SaveLoad description[] = {
327 };
328 static inline const SaveLoadCompatTable compat_description = _gamelog_action_sl_compat;
329
330 void Save(LoggedAction *la) const override
331 {
332 SlSetStructListLength(la->change.size());
333
334 for (auto &lc : la->change) {
335 assert(lc->ct < GamelogChangeType::End);
336 SlObject(lc.get(), this->GetDescription());
337 }
338 }
339
340 void LoadChange(LoggedAction *la, GamelogChangeType type) const
341 {
342 std::unique_ptr<LoggedChange> lc = MakeLoggedChange(type);
343 SlObject(lc.get(), this->GetLoadDescription());
344 la->change.push_back(std::move(lc));
345 }
346
347 void Load(LoggedAction *la) const override
348 {
351 while ((type = static_cast<GamelogChangeType>(SlReadByte())) != GamelogChangeType::None) {
352 if (type >= GamelogChangeType::End) SlErrorCorrupt("Invalid gamelog change type");
353 LoadChange(la, (GamelogChangeType)type);
354 }
355 return;
356 }
357
358 size_t length = SlGetStructListLength(UINT32_MAX);
359 la->change.reserve(length);
360
361 for (size_t i = 0; i < length; i++) {
362 LoadChange(la, (GamelogChangeType)SlReadByte());
363 }
364 }
365
366 void LoadCheck(LoggedAction *la) const override { this->Load(la); }
367};
368
369static const SaveLoad _gamelog_desc[] = {
374};
375
376struct GLOGChunkHandler : ChunkHandler {
377 GLOGChunkHandler() : ChunkHandler("GLOG", ChunkType::Table) {}
378
379 void LoadCommon(Gamelog &gamelog) const
380 {
381 assert(gamelog.data->action.empty());
382
383 const std::vector<SaveLoad> slt = SlCompatTableHeader(_gamelog_desc, _gamelog_sl_compat);
384
387 while ((type = static_cast<GamelogActionType>(SlReadByte())) != GamelogActionType::None) {
388 if (type >= GamelogActionType::End) SlErrorCorrupt("Invalid gamelog action type");
389
390 LoggedAction &la = gamelog.data->action.emplace_back();
392 SlObject(&la, slt);
393 }
394 return;
395 }
396
397 while (SlIterateArray() != -1) {
398 LoggedAction &la = gamelog.data->action.emplace_back();
399 SlObject(&la, slt);
400 }
401 }
402
403 void Save() const override
404 {
405 SlTableHeader(_gamelog_desc);
406
407 uint i = 0;
408 for (LoggedAction &la : _gamelog.data->action) {
409 SlSetArrayIndex(i++);
410 SlObject(&la, _gamelog_desc);
411 }
412 }
413
414 void Load() const override
415 {
416 this->LoadCommon(_gamelog);
417 }
418
419 void LoadCheck(size_t) const override
420 {
421 this->LoadCommon(_load_check_data.gamelog);
422 }
423};
424
425static const GLOGChunkHandler GLOG;
426static const ChunkHandlerRef gamelog_chunk_handlers[] = {
427 GLOG,
428};
429
430extern const ChunkHandlerTable _gamelog_chunk_handlers(gamelog_chunk_handlers);
Default handler for saving/loading an object to/from disk.
Definition saveload.h:585
SaveLoadTable GetDescription() const override
Definition saveload.h:587
SaveLoadTable GetLoadDescription() const
Get the description for how to load the chunk.
void Save(LoggedAction *la) const override
Save the object to disk.
void Load(LoggedAction *la) const override
Load the object from disk.
void LoadCheck(LoggedAction *la) const override
Similar to load, but used only to validate savegames.
static const SaveLoad description[]
We need to store something, so store a "true" value.
void Save(LoggedChange *lc) const override
Save the object to disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Load(LoggedChange *lc) const override
Load the object from disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Load(LoggedChange *lc) const override
Load the object from disk.
void Save(LoggedChange *lc) const override
Save the object to disk.
void Load(LoggedChange *lc) const override
Load the object from disk.
void Save(LoggedChange *lc) const override
Save the object to disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Load(LoggedChange *lc) const override
Load the object from disk.
void Save(LoggedChange *lc) const override
Save the object to disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Load(LoggedChange *lc) const override
Load the object from disk.
void Save(LoggedChange *lc) const override
Save the object to disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Load(LoggedChange *lc) const override
Load the object from disk.
void Save(LoggedChange *lc) const override
Save the object to disk.
void Save(LoggedChange *lc) const override
Save the object to disk.
void Load(LoggedChange *lc) const override
Load the object from disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Load(LoggedChange *lc) const override
Load the object from disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Save(LoggedChange *lc) const override
Save the object to disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Save(LoggedChange *lc) const override
Save the object to disk.
void Load(LoggedChange *lc) const override
Load the object from disk.
void Load(LoggedChange *lc) const override
Load the object from disk.
static std::array< char, GAMELOG_REVISION_LENGTH > revision_text
Temporary location to store the old revision text.
static const size_t GAMELOG_REVISION_LENGTH
Length of the old revision text length.
void Save(LoggedChange *lc) const override
Save the object to disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
void Load(LoggedChange *lc) const override
Load the object from disk.
void Save(LoggedChange *lc) const override
Save the object to disk.
void LoadCheck(LoggedChange *lc) const override
Similar to load, but used only to validate savegames.
Declarations for savegames operations.
LoadCheckData _load_check_data
Data loaded from save during SL_LOAD_CHECK.
Definition fios_gui.cpp:42
Gamelog _gamelog
Gamelog instance.
Definition gamelog.cpp:30
GamelogChangeType
Type of logged change.
Definition gamelog.h:31
@ GRFCompat
Loading compatible GRF.
Definition gamelog.h:38
@ GRFAdd
Removed GRF.
Definition gamelog.h:36
@ Revision
Changed game revision string.
Definition gamelog.h:33
@ GRFParam
GRF parameter changed.
Definition gamelog.h:39
@ Setting
Non-networksafe setting value changed.
Definition gamelog.h:35
@ GRFRem
Added GRF.
Definition gamelog.h:37
@ GRFMove
GRF order changed.
Definition gamelog.h:40
@ Mode
Scenario editor x Game, different landscape.
Definition gamelog.h:32
@ None
In savegames, end of list.
Definition gamelog.h:44
@ End
End marker.
Definition gamelog.h:43
@ Emergency
Emergency savegame.
Definition gamelog.h:42
@ GRFBug
GRF bug triggered.
Definition gamelog.h:41
@ OldVer
Loaded from savegame without logged data.
Definition gamelog.h:34
GamelogActionType
The actions we log.
Definition gamelog.h:18
@ None
No logging active; in savegames, end of list.
Definition gamelog.h:27
@ End
End marker.
Definition gamelog.h:26
Declaration shared among gamelog.cpp and saveload/gamelog_sl.cpp.
Loading for gamelog chunks before table headers were added.
const SaveLoadCompat _gamelog_emergency_sl_compat[]
Original field order for SlGamelogEmergency.
const SaveLoadCompat _gamelog_mode_sl_compat[]
Original field order for SlGamelogMode.
const SaveLoadCompat _gamelog_grfmove_sl_compat[]
Original field order for SlGamelogGrfmove.
const SaveLoadCompat _gamelog_action_sl_compat[]
Original field order for SlGamelogAction.
const SaveLoadCompat _gamelog_oldver_sl_compat[]
Original field order for SlGamelogOldver.
const SaveLoadCompat _gamelog_revision_sl_compat[]
Original field order for SlGamelogRevision.
const SaveLoadCompat _gamelog_sl_compat[]
Original field order for _gamelog_desc.
const SaveLoadCompat _gamelog_setting_sl_compat[]
Original field order for SlGamelogSetting.
const SaveLoadCompat _gamelog_grfrem_sl_compat[]
Original field order for SlGamelogGrfrem.
const SaveLoadCompat _gamelog_grfbug_sl_compat[]
Original field order for SlGamelogGrfbug.
const SaveLoadCompat _gamelog_grfadd_sl_compat[]
Original field order for SlGamelogGrfadd.
const SaveLoadCompat _gamelog_grfcompat_sl_compat[]
Original field order for SlGamelogGrfcompat.
const SaveLoadCompat _gamelog_grfparam_sl_compat[]
Original field order for SlGamelogGrfparam.
A number of safeguards to prevent using unsafe methods.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
size_t SlGetStructListLength(size_t limit)
Get the length of this list; if it exceeds the limit, error out.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
Definition saveload.cpp:748
void SlErrorCorrupt(const std::string &msg)
Error handler for corrupt savegames.
Definition saveload.cpp:372
uint8_t SlReadByte()
Wrapper for reading a byte from the buffer.
Definition saveload.cpp:413
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
void SlSetStructListLength(size_t length)
Set the length of this list.
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...
Definition saveload.h:753
#define SLE_GLOBAL_ADDRESS(variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a global...
Definition saveload.h:760
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
Definition saveload.h:512
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
Definition saveload.h:515
std::span< const struct SaveLoadCompat > SaveLoadCompatTable
A table of SaveLoadCompat entries.
Definition saveload.h:518
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
Definition saveload.h:1225
@ StringGamelog
Saveload version: 314, GitHub pull request: 10801 Use std::string in gamelog.
Definition saveload.h:361
@ U64TickCounter
Saveload version: 300, GitHub pull request: 10035 Make tick counter 64bit to avoid wrapping.
Definition saveload.h:345
@ MinVersion
First savegame version.
Definition saveload.h:36
@ RiffToArray
Saveload version: 294, GitHub pull request: 9375 Changed many ChunkType::Riff chunks to ChunkType::A...
Definition saveload.h:337
@ Table
An Array with a header describing the elements.
Definition saveload.h:449
Functions/types related to errors from savegames.
Definition of base types and functions in a cross-platform compatible way.
static void StrMakeValid(Builder &builder, StringConsumer &consumer, StringValidationSettings settings)
Copies the valid (UTF-8) characters from consumer to the builder.
Definition string.cpp:118
Functions related to low-level strings.
ChunkType type
Type of the chunk.
Definition saveload.h:462
ChunkHandler(ChunkId id, ChunkType type)
Create this ChunkHandler.
Definition saveload.h:469
void LoadCheck(size_t) const override
Load the chunk for game preview.
void Save() const override
Save the chunk.
void Load() const override
Load the chunk.
Contains information about one logged action that caused at least one logged change.
std::vector< std::unique_ptr< LoggedChange > > change
Logged changes in this action.
GamelogActionType at
Type of action.
A log entry for a NewGRF that was added.
A log entry for a NewGRF bug.
A log entry for a NewGRF that was changed.
A log entry for a NewGRF that was moved.
A log entry for a NewGRF for which a parameter was changed.
A log entry for a NewGRF that was removed.
Log element for the change of the game mode and landscape.
A log entry for loading a really old savegame.
A log entry for a change in OpenTTD version.
A log entry for changing a setting.
Container for any change that we deem needs to be logged.
GamelogChangeType ct
The type of change.
SaveLoad type struct.
Definition saveload.h:763
static SaveLoad StructList(std::string name, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion)
Storage of a list of structs, optionally in some savegame versions.
Definition saveload.h:1102
static SaveLoad SaveByte(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion)
Storage of a byte variable in some savegame versions that is not automatically read by the SaveLoad c...
Definition saveload.h:1124
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.
Definition saveload.h:925
static SaveLoad Array(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of an array in some savegame versions.
Definition saveload.h:1025
static SaveLoad Struct(std::string name, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion)
Storage of a structs, optionally in some savegame versions.
Definition saveload.h:1000
static SaveLoad String(std::string name, AddressFunction< T > address_func, StringValidationSettings string_validation_settings={}, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a string in some savegame versions.
Definition saveload.h:976