Esempio n. 1
0
 public override bool Intersects(Shape shape)
 {
     if (shape  is  Circle)
     {
         return(shape.Intersects(this));
     }
     return(base.Intersects(shape));
 }
Esempio n. 2
0
        public bool Contains(Shape other)
        {
            if (other.Intersects(this)) {
                return false;
            }

            for (int i = 0; i < other.GetPointCount(); i++) {
                float[] pt = other.GetPoint(i);
                if (!Contains(pt[0], pt[1])) {
                    return false;
                }
            }

            return true;
        }
Esempio n. 3
0
        public bool Contains(Shape other)
        {
            if (other.Intersects(this))
            {
                return(false);
            }

            for (int i = 0; i < other.GetPointCount(); i++)
            {
                float[] pt = other.GetPoint(i);
                if (!Contains(pt[0], pt[1]))
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 4
0
 /// <summary>
 /// 判断两个Shape是否相交
 /// </summary>
 ///
 /// <param name="s1"></param>
 /// <param name="s2"></param>
 /// <returns></returns>
 public static bool Intersects(Shape s1, Shape s2)
 {
     if (s1 == null || s2 == null)
     {
         return false;
     }
     return s1.Intersects(s2);
 }
Esempio n. 5
0
 public override bool Intersects(Shape shape)
 {
     if (shape  is  Circle) {
         return shape.Intersects(this);
     }
     return base.Intersects(shape);
 }