public sealed class DestroyEntitiesCommandDeleting entities, and putting them back.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Delete is the primitive and create is written in terms of it. Undoing a creation is a deletion and undoing a deletion is a restore, so one snapshot type serves both and the two commands differ only in which way round Do and Undo are. Writing them separately would be two chances to get the sibling order wrong.
⚠ A delete takes the whole subtree. Destroying a parent and leaving its children is a set of orphans holding a Parent that names a dead entity, and every walk over the hierarchy then throws — see Hierarchy.DestroySubtree. So the children go too, and the snapshot remembers all of them.
Fields and properties (1)
public string NameWhat this is called in the undo history, as a person would say it.
Methods (5)
public DestroyEntitiesCommand(SceneDocument document, IEnumerable<Entity> entities)Describes deleting some entities and everything below them.
public void Do(EditorContext context)Applies the change.
public void Undo(EditorContext context)Puts back exactly what Do changed.
public bool TryMergeWith(IEditorCommand previous, out IEditorCommand? merged)public void Dispose()
Used by (1)
- SceneDocumentVixen.Editor.SceneView