Add beam shear clone strategies
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
|
||||
namespace StructureHelperLogics.Models.BeamShears
|
||||
{
|
||||
public class BeamShear : IBeamShear
|
||||
{
|
||||
|
||||
private ICloneStrategy<IBeamShear> cloneStrategy;
|
||||
public Guid Id { get; }
|
||||
public IBeamShearRepository Repository { get; } = new BeamShearRepository(Guid.NewGuid());
|
||||
public IBeamShearRepository Repository { get; set; } = new BeamShearRepository(Guid.NewGuid());
|
||||
public BeamShear(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
@@ -18,7 +14,10 @@ namespace StructureHelperLogics.Models.BeamShears
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var cloningStrategy = new DeepCloningStrategy();
|
||||
cloneStrategy = new BeamShearCloneStrategy(cloningStrategy);
|
||||
var newItem = cloneStrategy.GetClone(this);
|
||||
return newItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user