/// <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); } }
private void UpdatePolygon() { switch (this.SpellData.Type) { case SkillShotType.SkillshotCircle: this.Circle.UpdatePolygon(); this.Polygon = this.Circle; this.Circle.UpdatePolygon(Configs.ExtraEvadeDistance); this.EvadePolygon = this.Circle; break; case SkillShotType.SkillshotLine: case SkillShotType.SkillshotMissileLine: this.Rectangle.UpdatePolygon(); this.Polygon = this.Rectangle; this.Rectangle.UpdatePolygon(Configs.ExtraEvadeDistance); this.EvadePolygon = this.Rectangle; break; case SkillShotType.SkillshotCone: this.Sector.UpdatePolygon(); this.Polygon = this.Sector; this.Sector.UpdatePolygon(Configs.ExtraEvadeDistance); this.EvadePolygon = this.Sector; break; case SkillShotType.SkillshotRing: this.Ring.UpdatePolygon(); this.Polygon = this.Ring; this.Ring.UpdatePolygon(Configs.ExtraEvadeDistance); this.EvadePolygon = this.Ring; break; case SkillShotType.SkillshotArc: this.Arc.UpdatePolygon(); this.Polygon = this.Arc; this.Arc.UpdatePolygon(Configs.ExtraEvadeDistance); this.EvadePolygon = this.Arc; break; } }
/// <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; }