public static void FindByColor(Bouquete b, string color) { foreach (Flower item in b.Flwrs) { if (item.color == color) { Console.WriteLine($"Цветок с цветом {color} был найден. "); } } }
public static void ParseFile(Bouquete bq1) { bool not_initialized = true; using (StreamReader stream = new StreamReader(@"D:/Visual/3 sem/6 lab/6_lab.txt")) { while (stream.ReadLine() is string line) { switch (line) { case "#Flower" when not_initialized: Flower fl = new Flower(int.Parse(stream.ReadLine()), stream.ReadLine()); bq1.Add(fl); break; } } } }
public static void FS(Bouquete b) { b.Flwrs.Sort(); }