private bool overlaps(Rectangle rect) { foreach (Rectangle r in detectedObjects) { if (rect.IntersectsWith(r)) return true; } return false; }