src/newgrf_storage.cpp
author skidd13
Mon, 19 Nov 2007 21:32:20 +0000
changeset 7929 6c9b25842b0f
parent 7609 b70ffc13652a
child 8130 d2eb7d04f6e1
permissions -rw-r--r--
(svn r11482) -Codechange: Remove the doubled function ClrBitT and rename the remaining to fit with the naming style
/* $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();
}