Add Force DTOs

This commit is contained in:
Evgeny Redikultsev
2024-10-12 21:30:21 +05:00
parent 2c5c5db43a
commit 7e54aa0407
64 changed files with 1237 additions and 216 deletions

View File

@@ -1,28 +1,33 @@
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Interfaces;
using StructureHelperCommon.Models.Forces.Logics;
using System;
namespace StructureHelperCommon.Models.Forces
{
public class DesignForceTuple : IDesignForceTuple
{
private IUpdateStrategy<IDesignForceTuple> updateStrategy = new DesignForceTupleUpdateStrategy();
public Guid Id { get; }
public LimitStates LimitState { get; set; }
public CalcTerms CalcTerm { get; set; }
public IForceTuple ForceTuple { get; set; }
public IForceTuple ForceTuple { get; set; } = new ForceTuple();
public DesignForceTuple(LimitStates limitState, CalcTerms calcTerm) : this()
public DesignForceTuple(Guid id)
{
LimitState = limitState;
CalcTerm = calcTerm;
Id = id;
}
public DesignForceTuple()
public DesignForceTuple() : this (Guid.NewGuid())
{
ForceTuple = new ForceTuple();
}
public object Clone()
{
var newTuple = new DesignForceTuple(this.LimitState, this.CalcTerm);
newTuple.ForceTuple = this.ForceTuple.Clone() as ForceTuple;
var newTuple = new DesignForceTuple();
updateStrategy.Update(newTuple, this);
return newTuple;
}
}