private List <QVTPoint> CreateQVTPointList(int buildingNumber, QVPointStorage qVPointStorage, TemperaturePointStorage temperatureStorage) { var list = new List <QVTPoint>(); var qvpoints = qVPointStorage.GetQVPoints(buildingNumber); var tpoints = temperatureStorage.GetTemperaturePoints(buildingNumber); int i = 0; // Для qvpoints. int k = 0; // Для tpoints. while (i < qvpoints.Count && k < tpoints.Count) { if (qvpoints[i].DateBegin <= tpoints[k].TimeBegin && qvpoints[i].DateEnd >= tpoints[k].TimeBegin) { list.Add(new QVTPoint(qvpoints[i], tpoints[k])); k++; } else if (tpoints[k].TimeBegin > qvpoints[i].DateEnd) { i++; } else if (tpoints[k].TimeBegin < qvpoints[i].DateBegin) { k++; } } return(list); }
// public void InitBuildingStorage(QVPointStorage qVPointStorage, TemperaturePointStorage temperatureStorage) { for (int i = 0; i < 19; i++) { var list = new List <QVTPoint>(); buildings[i] = new Building(i, CreateQVTPointList(i, qVPointStorage, temperatureStorage)); } }