src/newgrf_storage.cpp
author truebrain
Mon, 30 Jun 2008 13:51:28 +0000
branchnoai
changeset 11102 aacdde10b4ad
parent 9723 eee46cb39750
permissions -rw-r--r--
(svn r13660) [NoAI] -Fix: Is(Tunnel|Bridge)Tile could cause asserts (spotted by Yexo and ST_)
/* $Id$ */

/** @file newgrf_storage.cpp Functionality related to the temporary and persistent storage arrays for NewGRFs. */

#include "stdafx.h"
#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();
}