Exemplo n.º 1
0
 public bool IsAnyOfTheCornerPointsWithIn(OverlappingRectangle other)
 {
     var isBottomLeftWithIn = IsPointWith(other, MinX, MinY);
     var isBottomRightWithIn = IsPointWith(other, MaxX, MinY);
     var isTopLeftWithIn = IsPointWith(other, MinX, MaxY);
     var isTopRightWithIn = IsPointWith(other, MaxX, MaxY);
     return isBottomLeftWithIn || isBottomRightWithIn || isTopLeftWithIn || isTopRightWithIn;
 }
Exemplo n.º 2
0
 private static bool IsPointWith(OverlappingRectangle other, int x, int y)
 {
     return x >= other.MinX && x <= other.MaxX && y >= other.MinY && y <= other.MaxY;
 }
Exemplo n.º 3
0
 public bool IsOverlappedWith(OverlappingRectangle other)
 {
     return IsAnyOfTheCornerPointsWithIn(other) || other.IsAnyOfTheCornerPointsWithIn(this);
 }