public static void FindByColor(Bouquete b, string color) { foreach (Flower item in b.Flwrs) { if (item.color == color) { Console.WriteLine($"Цветок с цветом {color} был найден. Его цена: {item.price}"); } } }
public static void ParseFile(Bouquete bq1) { bool not_initialized = true; using (StreamReader stream = new StreamReader(@"E:\ООП\Lab_6\Lab_6\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(); }