OpenTTD Source
20241108-master-g80f628063a
|
Base class for all persistent NewGRF storage arrays. More...
#include <newgrf_storage.h>
Public Member Functions | |
virtual | ~BasePersistentStorageArray () |
Remove references to use. | |
Static Public Member Functions | |
static void | SwitchMode (PersistentStorageMode mode, bool ignore_prev_mode=false) |
Clear temporary changes made since the last call to SwitchMode, and set whether subsequent changes shall be persistent or temporary. More... | |
Data Fields | |
uint32_t | grfid |
GRFID associated to this persistent storage. A value of zero means "default". | |
uint8_t | feature |
NOSAVE: Used to identify in the owner of the array in debug output. | |
TileIndex | tile |
NOSAVE: Used to identify in the owner of the array in debug output. | |
Protected Member Functions | |
virtual void | ClearChanges ()=0 |
Discard temporary changes. | |
Static Protected Member Functions | |
static bool | AreChangesPersistent () |
Check whether currently changes to the storage shall be persistent or temporary till the next call to ClearChanges(). | |
Static Private Attributes | |
static bool | gameloop |
static bool | command |
static bool | testmode |
Base class for all persistent NewGRF storage arrays.
Nothing fancy, only here so we have a generalised access to the virtual methods.
Definition at line 33 of file newgrf_storage.h.
|
static |
Clear temporary changes made since the last call to SwitchMode, and set whether subsequent changes shall be persistent or temporary.
mode | Mode switch affecting temporary/persistent changes. |
ignore_prev_mode | Disable some sanity checks for exceptional call circumstances. |
Definition at line 54 of file newgrf_storage.cpp.
References PSM_ENTER_COMMAND, PSM_ENTER_GAMELOOP, PSM_ENTER_TESTMODE, PSM_LEAVE_COMMAND, PSM_LEAVE_GAMELOOP, and PSM_LEAVE_TESTMODE.
Referenced by CommandHelperBase::InternalExecuteProcessResult(), and CommandHelperBase::InternalExecuteValidateTestAndPrepExec().