public void FilterOutType(Type type)
{
LinkedList<IAction> newUndo = new LinkedList<IAction>();
foreach (IAction action in undoStack)
{
if (type.Equals(action.GetType()))
action.Dispose();
else
newUndo.AddLast(action);
}
undoStack = newUndo;
LinkedList<IAction> newRedo = new LinkedList<IAction>();
foreach (IAction action in redoStack)
{
if (type.Equals(action.GetType()))
action.Dispose();
else
newRedo.AddLast(action);
}
if (firstBiomeAction != null && type == typeof(BiomeAction))
firstBiomeAction = null;
if (firstPopulateAction != null && type == typeof(PopulateAction))
firstPopulateAction = null;
if (firstSelectionAction != null && type == typeof(SelectionAction))
firstSelectionAction = null;
redoStack = newRedo;
}