// Returns TRUE if another class has one or overlapping student groups. public bool GroupsOverlap(CourseClass courseClass) { for (int i = 0; i < StudentGroups.Count; i++) for (int j = 0; j < courseClass.StudentGroups.Count; ++j) if (StudentGroups[i].Id == courseClass.StudentGroups[j].Id) return true; return false; }
// Returns TRUE if another class has same professor. public bool ProfessorOverlaps(CourseClass courseClass) { return Professor.Id == courseClass.Professor.Id; }