Exemplo n.º 1
0
        public void Undo(int inputCount)
        {
            if (inputCount > 1)
            {
                throw new ArgumentOutOfRangeException("Incorrect recovery point count.");
            }

            // Cancel current input save
            InternalPop(Count - currentRecoveryStart);
            int i = currentRecoveryCount;

            while (i-- != 0)
            {
                Push(savedTags.Pop(), savedData.Pop());
            }

            // Undo previous inputCount inputs
            while (inputCount-- != 0)
            {
                var interval = recoveryIntervals.Pop();
                InternalPop(Count - interval.Start);
                i = interval.Count;
                while (i-- != 0)
                {
                    Push(savedTags.Pop(), savedData.Pop());
                }
            }
        }
Exemplo n.º 2
0
        public void Undo(int inputCount)
        {
            Debug.Assert(history != null);

            GssNode <T> node;
            int         i = inputCount;

            while (i-- != 0)
            {
                while ((node = history.Pop()) != null)
                {
                }
            }

            Count = 0;
            while ((node = history.Pop()) != null)
            {
                front[Count++] = node;
            }

            this.currentLayer -= inputCount;
            this.currentStage  = 0;

            history.Push(null);

            UpdateDeterministicDepths();
        }