public string[] IdentifyGround(int[] b1) { string[] grounds = new string[5]; for (int i = 0; i < 5; i++) { string name = "unknown"; int length = NotePad.GetInfoFileLength(groundDirectory + (i + 1) + "\\info.txt"); string[,] theTable = NotePad.ReadInfoFromTXT(groundDirectory + (i + 1) + "\\info.txt"); for (int l = 0; l < length; l++) { if (b1[i] == Convert.ToInt32(theTable[l, 0])) { name = theTable[l, 1]; grounds[i] = name; break; } } if (name == "unknown") { NotePad.DoErrorLog("Неизвестное покрытие позиция " + (i + 1)); grounds[i] = "Неизвестная покрытие"; } } bool asphalt = false; bool mud = false; foreach (string x in grounds) { if (x == "Асфальт") { asphalt = true; } else { mud = true; } } if (asphalt) { Condition.coverage = "Асфальт"; if (mud) { Condition.coverage = "Смешанное"; } } else { Condition.coverage = "Бездорожье"; } NotePad.LastCoverage(Condition.coverage); return(grounds); }