/// <summary> /// Adds all of the points in the polygon to this instance. /// </summary> /// <param name="polygon">The Polygon</param> public void Add(Polygon polygon) { foreach (var point in polygon.Points) { this.Points.Add(point); } }
/// <summary> /// Converts a list of <see cref="IntPoint" />s to a <see cref="Polygon" /> /// </summary> /// <param name="list">List of <see cref="Polygon" /></param> /// <returns>Polygon made up of <see cref="IntPoint" />s</returns> public static Polygon ToPolygon(this List<IntPoint> list) { var polygon = new Polygon(); foreach (var point in list) { polygon.Add(new Vector2(point.X, point.Y)); } return polygon; }