示例#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);
 }