diff options
author | rubidium <rubidium@openttd.org> | 2007-09-22 12:59:43 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-09-22 12:59:43 +0000 |
commit | c68c83dffa2edbf854935effedeac0c4697d5db7 (patch) | |
tree | abf69599a75ef23c1a5e3ed954a9d8866fe64a27 /src/newgrf_storage.cpp | |
parent | 47dd4989a8dabe485d87743468b3eddb18e19bb6 (diff) | |
download | openttd-c68c83dffa2edbf854935effedeac0c4697d5db7.tar.xz |
(svn r11138) -Codechange: prepare some subsystems for persistent storage for NewGRFs.
Diffstat (limited to 'src/newgrf_storage.cpp')
-rw-r--r-- | src/newgrf_storage.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/newgrf_storage.cpp b/src/newgrf_storage.cpp new file mode 100644 index 000000000..c5c06b2f9 --- /dev/null +++ b/src/newgrf_storage.cpp @@ -0,0 +1,27 @@ +/* $Id$ */ + +/** @file newgrf_storage.cpp Functionality related to the temporary and persistent storage arrays for NewGRFs. */ + +#include "stdafx.h" +#include "helpers.hpp" +#include "newgrf_storage.h" +#include <set> + +/** The changed storage arrays */ +static std::set<BaseStorageArray*> _changed_storage_arrays; + +void AddChangedStorage(BaseStorageArray *storage) +{ + _changed_storage_arrays.insert(storage); +} + +void ClearStorageChanges(bool keep_changes) +{ + /* Loop over all changes arrays */ + for (std::set<BaseStorageArray*>::iterator it = _changed_storage_arrays.begin(); it != _changed_storage_arrays.end(); it++) { + (*it)->ClearChanges(keep_changes); + } + + /* And then clear that array */ + _changed_storage_arrays.clear(); +} |