Vixen
02b45cc4
csharp
public sealed class CompositeCommand

Several commands that undo and redo as one.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Undone in reverse, which is not a stylistic choice: the later commands may depend on what the earlier ones did — "create the entity" then "parent it" — and unwinding them in the order they ran would try to unparent something that no longer exists.

Fields and properties (2)

  • public string Name

    What this is called in the undo history, as a person would say it.

  • public IReadOnlyList<IEditorCommand> Commands

    What this is made of, in the order it runs.

Methods (3)

  • public CompositeCommand(string name, params IEditorCommand[] commands)

    Groups commands into one entry.

  • public void Do(EditorContext context)

    Applies the change.

  • public void Undo(EditorContext context)

    Puts back exactly what Do changed.

Used by (1)

  • CommandStackVixen.Editor.Core