private static bool checkForTwoAreasIntersection(Area i, Area j) { int iw = i.get_width() + i.get_area_x(), ih = i.get_length() + i.get_area_y(); int jw = j.get_width() + j.get_area_x(), jh = j.get_length() + j.get_area_y(); if ((!((iw <= j.get_area_x()) || (jw <= i.get_area_x()))) && (!((ih <= j.get_area_y()) || (jh <= i.get_area_y())))) { return true; } else { return false; } }
private static bool checkCheckForAreaExistence(Area i, List<Area> areas) { foreach (Area area in areas) { if ((i.get_width() == area.get_width()) && (i.get_length() == area.get_length()) && (i.get_area_x() == area.get_area_x()) && (i.get_area_y() == area.get_area_y())) { return false; } } return true; }