|
OpenTTD Source
14.0-beta1
|
Class for temporary storage of data. More...
#include <newgrf_storage.h>
Public Types | |
| using | StorageType = std::array< TYPE, SIZE > |
| using | StorageInitType = std::array< uint16_t, SIZE > |
Public Member Functions | |
| void | StoreValue (uint pos, int32_t value) |
| Stores some value at a given position. More... | |
| TYPE | GetValue (uint pos) const |
| Gets the value from a given position. More... | |
| void | ClearChanges () |
Data Fields | |
| StorageType | storage {} |
| Memory for the storage array. | |
| StorageInitType | init {} |
| Storage has been assigned, if this equals 'init_key'. | |
| uint16_t | init_key {1} |
| Magic key to 'init'. | |
Class for temporary storage of data.
On #ClearChanges that data is always zero-ed.
| TYPE | the type of variable to store. |
| SIZE | the size of the array. |
Definition at line 133 of file newgrf_storage.h.
|
inline |
Gets the value from a given position.
| pos | the position to get the data from |
Definition at line 160 of file newgrf_storage.h.
References TemporaryStorageArray< TYPE, SIZE >::init, TemporaryStorageArray< TYPE, SIZE >::init_key, and TemporaryStorageArray< TYPE, SIZE >::storage.
|
inline |
Stores some value at a given position.
| pos | the position to write at |
| value | the value to write |
Definition at line 146 of file newgrf_storage.h.
References TemporaryStorageArray< TYPE, SIZE >::init, TemporaryStorageArray< TYPE, SIZE >::init_key, and TemporaryStorageArray< TYPE, SIZE >::storage.