summaryrefslogtreecommitdiff
path: root/src/newgrf_storage.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_storage.h')
-rw-r--r--src/newgrf_storage.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/newgrf_storage.h b/src/newgrf_storage.h
index 93aab09dc..cf7690a92 100644
--- a/src/newgrf_storage.h
+++ b/src/newgrf_storage.h
@@ -21,7 +21,14 @@ struct BaseStorageArray
* - reverting to the previous version
* @param keep_changes do we save or revert the changes since the last ClearChanges?
*/
- virtual void ClearChanges(bool keep_changes) {}
+ virtual void ClearChanges(bool keep_changes) = 0;
+
+ /**
+ * Stores some value at a given position.
+ * @param pos the position to write at
+ * @param value the value to write
+ */
+ virtual void Store(uint pos, uint32 value) = 0;
};
/**
@@ -54,7 +61,7 @@ struct PersistentStorageArray : BaseStorageArray {
* @param pos the position to write at
* @param value the value to write
*/
- void Store(uint pos, TYPE value)
+ void Store(uint pos, uint32 value)
{
/* Out of the scope of the array */
if (pos >= SIZE) return;
@@ -83,7 +90,7 @@ struct PersistentStorageArray : BaseStorageArray {
* @param pos the position to get the data from
* @return the data from that position
*/
- TYPE Get(uint pos)
+ TYPE Get(uint pos) const
{
/* Out of the scope of the array */
if (pos >= SIZE) return 0;
@@ -124,7 +131,7 @@ struct TemporaryStorageArray : BaseStorageArray {
* @param pos the position to write at
* @param value the value to write
*/
- void Store(uint pos, TYPE value)
+ void Store(uint pos, uint32 value)
{
/* Out of the scope of the array */
if (pos >= SIZE) return;
@@ -138,7 +145,7 @@ struct TemporaryStorageArray : BaseStorageArray {
* @param pos the position to get the data from
* @return the data from that position
*/
- TYPE Get(uint pos)
+ TYPE Get(uint pos) const
{
/* Out of the scope of the array */
if (pos >= SIZE) return 0;