49 lines
1.0 KiB
C#
49 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Numerics;
|
|
using System.Text;
|
|
|
|
namespace StgSharp.Geometries
|
|
{
|
|
public class Polygon : IGeometryCombination
|
|
{
|
|
internal Point[] pointsArray;
|
|
|
|
public Polygon(uint bornTime) : base(bornTime)
|
|
{
|
|
|
|
}
|
|
|
|
public Polygon(int pointNum)
|
|
{
|
|
pointsArray = new Point[pointNum];
|
|
this.toSimpleGeometry();
|
|
}
|
|
|
|
public Polygon(Point[] pointsArray)
|
|
{
|
|
PointsArray = pointsArray;
|
|
this.toSimpleGeometry();
|
|
}
|
|
|
|
internal override void toSimpleGeometry()
|
|
{
|
|
Point begin = pointsArray[0];
|
|
for (int i = 1; i <= pointsArray.Length; i++)
|
|
{
|
|
Triangle a = new Triangle(this._bornTick);
|
|
this.Add(a);
|
|
}
|
|
|
|
}
|
|
|
|
public Point[] PointsArray
|
|
{
|
|
get { return pointsArray; }
|
|
set { pointsArray = value; }
|
|
}
|
|
|
|
|
|
}
|
|
}
|