Example #1
0
 internal void ClearHistory()
 {
     HistoryUndo.Clear();
     HistoryRedo.Clear();
     Host.OnCommandPropertiesChange(new CommandPropertiesChangeEventArgs(AddinCommand.Undo, HistoryUndo.Count > 1));
     Host.OnCommandPropertiesChange(new CommandPropertiesChangeEventArgs(AddinCommand.Redo, HistoryRedo.Count > 0));
 }
Example #2
0
 void StopRewind()
 {
     //Debug.Log("Stop Rewind");
     //playerRigidbody.isKinematic = false;
     isRewinding = false;
     playerController.UnFreezeMotion();
     storedPositions.Clear();
     isInCooldown = true;
     StartCoroutine("ResetCooldown");
 }
        public CommandHistory Store(string commandName, params object[] args)
        {
            if (backup.Count > 0)
            {
                backup.Clear();
            }

            history.Push(new KeyValuePair <string, object[]>(commandName, args));
            return(this);
        }
Example #4
0
        public void Clear01()
        {
            var capacity = 4;
            var cq       = new CircularStack <int>(capacity);

            Assert.AreEqual(capacity, cq.Capacity());
            for (int i = 0; i < 6; i++)
            {
                cq.Push(i);
            }
            Assert.AreEqual(capacity, cq.Count());
            cq.Clear();
            Assert.AreEqual(0, cq.Count());
            for (int i = 0; i < 6; i++)
            {
                cq.Push(i);
            }
            Assert.AreEqual(capacity, cq.Count());
        }