using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RichCreator.Utility.Structs { public class ZTPolygonObj { public ZTPolygonObj() { } public ZTPolygonObj(ZTPointObj[] points) { this.Points = points; } public ZTPointObj[] Points { get; set; } public int Length { get { return Points.Length; } } public ZTPointObj this[int index] { get { return Points[index]; } set { Points[index] = value; } } public ZTPolygon To() { ZTPoint[] pos = new ZTPoint[this.Points.Length]; for (int i = 0; i < pos.Length; i++) { pos[i] = this.Points[i].To(); } return new ZTPolygon(pos); } public static ZTPolygonObj From(ZTPolygon obj) { ZTPointObj[] points = new ZTPointObj[obj.Points.Length]; for (int i = 0; i < obj.Points.Length; i++) { points[i] = ZTPointObj.From(obj.Points[i]); } return new ZTPolygonObj(points); } } }