using TraceCad.Core.Model;

namespace TraceCad.Core.Commands;

public sealed class DeleteEntityCommand(Entity entity) : IDocumentCommand
{
    public string Name => "Delete Entity";

    public Entity Entity { get; } = entity;

    public void Apply(SketchDocument document) => document.RemoveEntity(Entity.Id);

    public void Revert(SketchDocument document) => document.AddEntity(Entity);
}
