コード例 #1
0
ファイル: Polygon.cs プロジェクト: CONANLXF/Berb.Common
 /// <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);
     }
 }
コード例 #2
0
ファイル: MathUtils.cs プロジェクト: CjShu/LeagueSharp.SDKEx
        /// <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;
        }