Exemplo n.º 1
0
        internal void ResetUndo()
        {
            undoStack.Clear();
            redoStack.Clear();
            notifyBuildListeners.Clear();
            notifyDismantleListeners.Clear();

            if (NebulaModAPI.IsMultiplayerActive)
            {
                if (NebulaModAPI.MultiplayerSession.Factories.IsIncomingRequest.Value)
                {
                    return;
                }
            }

            UIRealtimeTip.Popup("UndoClearedMessage".Translate(), false);
            VFAudio.Create("cancel-0", null, Vector3.zero, true, 4);
        }
Exemplo n.º 2
0
        public static void RegisterUndo(BTUndoState undoState)
        {
            if (undoState != null && undoState.CanUndo)
            {
                if (m_undoStack.Count > 0)
                {
                    BTUndoGroup topGroup = m_undoStack.Peek() as BTUndoGroup;
                    if (topGroup != null && topGroup.IsOpen)
                    {
                        topGroup.AddUndoState(undoState);
                        m_redoStack.Clear();
                        return;
                    }
                }

                m_undoStack.Push(undoState);
                m_redoStack.Clear();
            }
        }
Exemplo n.º 3
0
        public void FixedSizeStack_CanClear()
        {
            FixedSizeStack<int> stack = new FixedSizeStack<int>(10);
            for (int i = 0; i < 10; i++)
            {
                stack.Push(i);
            }
            Assert.AreEqual(10, stack.Count);

            stack.Clear();
            Assert.AreEqual(0, stack.Count);
        }
Exemplo n.º 4
0
 protected override void clearStack()
 {
     stack.Clear();
 }
Exemplo n.º 5
0
 public static void Clear()
 {
     m_undoStack.Clear();
     m_redoStack.Clear();
 }