Пример #1
0
    private void DoRedo(BeatmapAction action)
    {
        BeatmapActionParams param = new BeatmapActionParams(this);

        action.Redo(param);
        action.Active = true;
        nodeEditor.ObjectWasSelected();
    }
Пример #2
0
    public void Redo()
    {
        BeatmapAction firstNotActive = beatmapActions.FirstOrDefault(x => !x.Active);

        if (firstNotActive == null)
        {
            return;
        }
        Debug.Log($"Redid a {firstNotActive.GetType().Name}.");
        BeatmapActionParams param = new BeatmapActionParams(this);

        firstNotActive.Redo(param);
        firstNotActive.Active = true;
    }
Пример #3
0
    public void Undo()
    {
        BeatmapAction lastActive = beatmapActions.LastOrDefault(x => x.Active);

        if (lastActive == null)
        {
            return;
        }
        Debug.Log($"Undid a {lastActive.GetType().Name}.");
        BeatmapActionParams param = new BeatmapActionParams(this);

        lastActive.Undo(param);
        lastActive.Active = false;
    }
Пример #4
0
    public void Redo()
    {
        if (!beatmapActions.Any())
        {
            return;
        }
        BeatmapAction firstNotActive = beatmapActions.FirstOrDefault(x => !x.Active);

        if (firstNotActive == null)
        {
            return;
        }
        Debug.Log($"Redid a {firstNotActive?.GetType()?.Name ?? "UNKNOWN"}. ({firstNotActive?.Comment ?? "Unknown comment."})");
        BeatmapActionParams param = new BeatmapActionParams(this);

        firstNotActive.Redo(param);
        firstNotActive.Active = true;
    }
Пример #5
0
    public void Undo()
    {
        if (!beatmapActions.Any())
        {
            return;
        }
        BeatmapAction lastActive = beatmapActions.LastOrDefault(x => x.Active);

        if (lastActive == null)
        {
            return;
        }
        Debug.Log($"Undid a {lastActive?.GetType()?.Name ?? "UNKNOWN"}. ({lastActive?.Comment ?? "Unknown comment."})");
        BeatmapActionParams param = new BeatmapActionParams(this);

        lastActive.Undo(param);
        lastActive.Active = false;
    }