/// <summary> /// Main Method for asking and then Searching for vegitable details /// </summary> /// <param name="vegitables"></param> static void DisplaySearchForVegitables(List <Vegitable> vegitables) { bool exit; do { string name = SearchVegitables(vegitables); if (name != "exit") { Vegitable vegitable = vegitables.FirstOrDefault(v => v.Name == name); DisplayVegitableInfo(vegitable); DisplayContinuePrompt(); exit = false; } else { exit = true; } } while (!exit); DisplayContinuePrompt(); }
/// <summary> /// Displaying the Vegitable Information /// </summary> /// <param name="vegitable"></param> static void DisplayVegitableInfo(Vegitable vegitable) { string vegTips; DisplayScreenHeader($"{vegitable.Name}'s Information"); Console.WriteLine($"Spacing: {vegitable.Spacing} inches"); Console.WriteLine($"Seed Depth: {vegitable.SeedDepth} inches"); Console.WriteLine($"Ammount of Sun: {vegitable.AmmountOfSun}"); Console.WriteLine($"Preffered Ph: {vegitable.Ph}"); Console.WriteLine($"When To Plant: {vegitable.PlantTime}"); Console.WriteLine(); vegTips = DisplayGetVegitableTips(vegitable.Name); Console.WriteLine($"Extra Tips: " + vegTips); }