using TraceCad.Core.Model;

namespace TraceCad.Core.Commands;

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

    public Entity Entity { get; } = entity;

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

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