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,4 +1,5 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Shapes;
using System;
using System.Collections.Generic;
@@ -10,6 +11,8 @@ namespace StructureHelperCommon.Models.Forces
{
public class DesignForcePair : IDesignForcePair
{
readonly IUpdateStrategy<IAction> updateStrategy = new ActionUpdateStrategy();
public Guid Id { get; }
public string Name { get; set; }
public IPoint2D ForcePoint { get; set; }
public bool SetInGravityCenter { get; set; }
@@ -17,12 +20,16 @@ namespace StructureHelperCommon.Models.Forces
public IForceTuple LongForceTuple { get; set; }
public IForceTuple FullForceTuple { get; set; }
public DesignForcePair()
public DesignForcePair(Guid id)
{
Id = id;
LongForceTuple = new ForceTuple();
FullForceTuple = new ForceTuple();
}
public DesignForcePair() : this(Guid.NewGuid()) {}
public IForceCombinationList GetCombinations()
{
throw new NotImplementedException();
@@ -30,7 +37,9 @@ namespace StructureHelperCommon.Models.Forces
public object Clone()
{
throw new NotImplementedException();
var newItem = new DesignForcePair();
updateStrategy.Update(newItem, this);
return newItem;
}
}
}