public bool Equals(Polygon other) { return(other != null && IsHole == other.IsHole && ClipperUtility.EqualWithinEpsilon(this, other) && Holes.Equals(other.Holes)); }
public override int GetHashCode() { int hash = 17; hash = hash * 23 + Points.Count.GetHashCode(); hash = hash * 23 + ClipperUtility.GetArea(this).GetHashCode(); foreach (Vector point in Points) { hash = hash * 23 + point.GetHashCode(); } hash = hash * 23 + (IsHole ? 31 : 0); hash = hash * 23 + Holes.GetHashCode(); return(hash); }
public bool Contains(Vector currentPlayerPosition) { Polygon pointPolygon = Polygon.AsCircle(.01f, currentPlayerPosition, 8); return(ClipperUtility.ContainsWithinEpsilon(this, pointPolygon)); }