public override bool Intersects(Shape shape) { if (shape is Circle) { return(shape.Intersects(this)); } return(base.Intersects(shape)); }
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; }
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); }
/// <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); }
public override bool Intersects(Shape shape) { if (shape is Circle) { return shape.Intersects(this); } return base.Intersects(shape); }