Exemple #1
0
 public static bool Collides(BoundingRectangle r, BoundingCircle c) => Collides(c, r);
Exemple #2
0
 /// <summary>
 /// Detects collision between two BoundingRectangles
 /// </summary>
 /// <param name="a">The first Bounding Rectangle</param>
 /// <param name="b">The Second Bounding Rectangle</param>
 /// <returns></returns>
 public static bool Collides(BoundingRectangle a, BoundingRectangle b)
 {
     return(!(a.Right < b.Left || a.Left > b.Right ||
              a.Top > b.Bottom || a.Bottom < b.Top
              ));
 }