public void SetAdjacentRooms() { for (int i = 0; i < RoomEdgeTilesPerCluster.Count; i++) { if (RoomEdgeTilesPerCluster[i].BuildingTileRooms.Count < 2) { continue; } for (int j = 0; j < RoomEdgeTilesPerCluster[i].BuildingTileRooms.Count; j++) { Room otherRoom = RoomEdgeTilesPerCluster[i].BuildingTileRooms[j]; if (otherRoom != this && !this.AdjacentRooms.Contains(otherRoom)) { Logger.Log(Logger.Building, "Add {0}.{1} as adjacent room for {2}.{3}", RoomBlueprint.Name, RoomRotation, otherRoom.RoomBlueprint.Name, otherRoom.RoomRotation); AddAdjacentRoom(otherRoom); if (!otherRoom.AdjacentRooms.Contains(this)) { Logger.Log(Logger.Building, "Add {0}.{1} as adjacent room for {2}.{3}", RoomBlueprint.Name, RoomRotation, otherRoom.RoomBlueprint.Name, otherRoom.RoomRotation); otherRoom.AddAdjacentRoom(this); } } } } }