Add polygon to DTO convert strategy
This commit is contained in:
53
DataAccess/DTOs/DTOEntities/Shapes/LinePolygonShapeDTO.cs
Normal file
53
DataAccess/DTOs/DTOEntities/Shapes/LinePolygonShapeDTO.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace DataAccess.DTOs
|
||||
{
|
||||
public class LinePolygonShapeDTO : ILinePolygonShape
|
||||
{
|
||||
private readonly List<IVertex> _vertices = [];
|
||||
[JsonProperty("Id")]
|
||||
public Guid Id { get; }
|
||||
[JsonProperty("Vertices")]
|
||||
public IReadOnlyList<IVertex> Vertices => _vertices;
|
||||
[JsonProperty("IsClosed")]
|
||||
public bool IsClosed { get; set; }
|
||||
|
||||
|
||||
public LinePolygonShapeDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public IVertex AddVertex(IVertex vertex)
|
||||
{
|
||||
_vertices.Add(vertex);
|
||||
return vertex;
|
||||
}
|
||||
|
||||
public IVertex AddVertexAfter(IVertex existing, IVertex vertex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IVertex AddVertexBefore(IVertex existing, IVertex vertex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_vertices.Clear();
|
||||
}
|
||||
|
||||
public IVertex InsertVertex(int index, IVertex vertex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void RemoveVertex(IVertex vertex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user