Change: Add ability to save/load std::deque<> containers.

This commit is contained in:
Peter Nelson
2019-01-18 22:15:27 +00:00
committed by PeterN
parent 60da05cf2a
commit 1c725fce47
2 changed files with 140 additions and 0 deletions

View File

@@ -195,6 +195,7 @@ enum SaveLoadTypes {
SL_ARR = 2, ///< Save/load an array.
SL_STR = 3, ///< Save/load a string.
SL_LST = 4, ///< Save/load a list.
SL_DEQUE = 5, ///< Save/load a deque.
/* non-normal save-load types */
SL_WRITEBYTE = 8,
SL_VEH_INCLUDE = 9,
@@ -287,6 +288,16 @@ typedef SaveLoad SaveLoadGlobVarList;
*/
#define SLE_CONDLST(base, variable, type, from, to) SLE_GENERAL(SL_LST, base, variable, type, 0, from, to)
/**
* Storage of a deque in some savegame versions.
* @param base Name of the class or struct containing the list.
* @param variable Name of the variable in the class or struct referenced by \a base.
* @param type Storage of the data in memory and in the savegame.
* @param from First savegame version that has the list.
* @param to Last savegame version that has the list.
*/
#define SLE_CONDDEQUE(base, variable, type, from, to) SLE_GENERAL(SL_DEQUE, base, variable, type, 0, from, to)
/**
* Storage of a variable in every version of a savegame.
* @param base Name of the class or struct containing the variable.