9703
|
1 |
/* $Id$ */
|
|
2 |
|
|
3 |
/** @file newgrf_storage.cpp Functionality related to the temporary and persistent storage arrays for NewGRFs. */
|
|
4 |
|
|
5 |
#include "stdafx.h"
|
|
6 |
#include "newgrf_storage.h"
|
|
7 |
#include <set>
|
|
8 |
|
|
9 |
/** The changed storage arrays */
|
|
10 |
static std::set<BaseStorageArray*> _changed_storage_arrays;
|
|
11 |
|
|
12 |
void AddChangedStorage(BaseStorageArray *storage)
|
|
13 |
{
|
|
14 |
_changed_storage_arrays.insert(storage);
|
|
15 |
}
|
|
16 |
|
|
17 |
void ClearStorageChanges(bool keep_changes)
|
|
18 |
{
|
|
19 |
/* Loop over all changes arrays */
|
|
20 |
for (std::set<BaseStorageArray*>::iterator it = _changed_storage_arrays.begin(); it != _changed_storage_arrays.end(); it++) {
|
|
21 |
(*it)->ClearChanges(keep_changes);
|
|
22 |
}
|
|
23 |
|
|
24 |
/* And then clear that array */
|
|
25 |
_changed_storage_arrays.clear();
|
|
26 |
}
|