예제 #1
0
 public void Add(OgmoAction action)
 {
     actions.Add(action);
 }
예제 #2
0
        public void BatchPerform(OgmoAction action)
        {
            if (action == null)
                return;

            batch.Add(action);
            action.Do();
        }
예제 #3
0
        /*
         *  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();
        }
예제 #4
0
 public void Add(OgmoAction action)
 {
     actions.Add(action);
 }