Exemple #1
0
 public bool Equals(Polygon other)
 {
     return(other != null &&
            IsHole == other.IsHole &&
            ClipperUtility.EqualWithinEpsilon(this, other) &&
            Holes.Equals(other.Holes));
 }
Exemple #2
0
        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);
        }
Exemple #3
0
        public bool Contains(Vector currentPlayerPosition)
        {
            Polygon pointPolygon = Polygon.AsCircle(.01f, currentPlayerPosition, 8);

            return(ClipperUtility.ContainsWithinEpsilon(this, pointPolygon));
        }