using TraceCad.Core.Model;

namespace TraceCad.Core.Commands;

public sealed class ReplaceEntityCommand(Entity original, Entity replacement) : IDocumentCommand
{
    public string Name => "Replace Entity";

    public Entity Original { get; } = original;

    public Entity Replacement { get; } = replacement;

    public void Apply(SketchDocument document)
    {
        document.ReplaceEntity(Replacement);
    }

    public void Revert(SketchDocument document)
    {
        document.ReplaceEntity(Original);
    }
}
