Beispiel #1
0
    /// <summary>
    /// Redoes the most recent undo.
    /// </summary>
    public void RedoAction()
    {
        while (m_deltaFuture.Count > 0 && !m_deltaFuture.Peek().Valid)
        {
            m_deltaFuture.Pop();
        }

        if (m_deltaFuture.Count == 0 ||
            (m_currentDelta != null && !m_currentIsUndo) ||
            !m_deltaFuture.Peek().CanRedo())
        {
            Dispatcher <Sfx> .Broadcast(AudioManager.kPlaySfx, Sfx.Invalid);

            return;
        }

        Dispatcher <Sfx> .Broadcast(AudioManager.kPlaySfx, Sfx.Select);

        m_currentIsUndo = false;
        m_currentDelta  = m_deltaFuture.Pop();
        m_deltaHistory.Push(m_currentDelta);
        m_currentDelta.RedoAction(this, OnDeltaDone);
    }