Files
StructureHelper/StructureHelperCommon/Models/Shapes/Logics/RectangleShapeCloneStrategy.cs
2025-07-20 21:45:07 +05:00

22 lines
684 B
C#

using StructureHelperCommon.Infrastructures.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Models.Shapes
{
public class RectangleShapeCloneStrategy : ICloneStrategy<IRectangleShape>
{
IUpdateStrategy<IRectangleShape> updateStrategy;
public IRectangleShape GetClone(IRectangleShape sourceObject)
{
RectangleShape clone = new RectangleShape(Guid.NewGuid());
updateStrategy ??= new RectangleShapeUpdateStrategy();
updateStrategy.Update(clone, sourceObject);
return clone;
}
}
}