public void CreateHallwayRooms(List <Room> rooms, List <Room> relevantRooms) { var toEvict = new List <Room>(); foreach (var room in rooms) { if (relevantRooms.Contains(room)) { continue; } if (GridFiller.HasLinkedCorridor(grid, room)) { GridFiller.FillRoom(grid, room); } else { toEvict.Add(room); } } rooms.RemoveAll(room => toEvict.Contains(room)); }