(svn r11138) -Codechange: prepare some subsystems for persistent storage for NewGRFs.

This commit is contained in:
rubidium
2007-09-22 12:59:43 +00:00
parent a0946e5d7e
commit ed96cd2711
9 changed files with 240 additions and 18 deletions

27
src/newgrf_storage.cpp Normal file
View File

@@ -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();
}