UpdateStrategy for Actions was added

This commit is contained in:
Evgeny Redikultsev
2023-07-09 19:46:36 +05:00
parent 03b882f54d
commit 3e0e51d0c9
30 changed files with 402 additions and 138 deletions

View File

@@ -1,17 +1,32 @@
namespace StructureHelperCommon.Models.Shapes
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Shapes.Logics;
using System;
namespace StructureHelperCommon.Models.Shapes
{
/// <inheritdoc />
public class Point2D : IPoint2D
{
private readonly IUpdateStrategy<IPoint2D> updateStrategy = new PointUpdateStrategy();
/// <inheritdoc />
public Guid Id { get; }
/// <inheritdoc />
public double X { get; set; }
/// <inheritdoc />
public double Y { get; set; }
public Point2D(Guid id)
{
Id = id;
}
public Point2D() : this(Guid.NewGuid()) { }
public object Clone()
{
var point = new Point2D() { X = X, Y = Y };
return point;
var newItem = new Point2D();
updateStrategy.Update(newItem, this);
return newItem;
}
}
}