public void Add(OgmoAction action) { actions.Add(action); }
public void BatchPerform(OgmoAction action) { if (action == null) return; batch.Add(action); action.Do(); }
/* * ACTIONS API */ public void Perform(OgmoAction action) { if (action == null) return; //If a batch is in progress, stop it! EndBatch(); //If you're over the undo limit, chop off an action while (UndoStack.Count >= Properties.Settings.Default.UndoLimit) UndoStack.RemoveFirst(); //If the level is so-far unchanged, change it and store that fact if (!Level.Changed) { action.LevelWasChanged = false; Level.Changed = true; } //Add the action to the undo stack and then do it! UndoStack.AddLast(action); action.Do(); //Clear the redo stack RedoStack.Clear(); }