// This Method will use a jump tree allows the user to select from optioned provided in the text file. private void jumpTree(int userChoice) { MainMenu Return = new MainMenu(); // Allows us to return to the main menu Algorithms algorithms = new Algorithms(); Algorithms.Eratosthenes primes = new Algorithms.Eratosthenes(); Algorithms.BubbleSort bubblesort = new Algorithms.BubbleSort(); Algorithms.Euclid euclid = new Algorithms.Euclid(); switch (userChoice) { case 1: bubblesort.entryScreen(); break; case 2: euclid.entryScreen(); break; case 3: primes.entryScreen(); break; case 4: Return.displayScreen(); break; default: Console.WriteLine("Something went wrong in the jumpTree"); break; } displayScreen(); }
// This Method will use a jump tree allows the user to select from optioned provided in the text file. private void jumpTree(int userChoice) { MainMenu Return = new MainMenu(); // Allows us to return to the main menu string recipePath = Tools.FindDir.getRecipeDir(); // Grabs path to recipes directory // Case 1 - 6 will display the recipes, case 7 will return us to the menu screen switch (userChoice) { case 1: Tools.Display.displayText(recipePath + "bakedChickenPotatoFinal.txt"); break; case 2: Tools.Display.displayText(recipePath + "beefstewFinal.txt"); break; case 3: Tools.Display.displayText(recipePath + "chickenCacciatoreFinal.txt"); break; case 4: Tools.Display.displayText(recipePath + "chickenStewFinal.txt"); break; case 5: Tools.Display.displayText(recipePath + "sweetSourChickenFinal.txt"); break; case 6: Tools.Display.displayText(recipePath + "tomatoRiceSoupFinal.txt"); break; case 7: Return.displayScreen(); break; default: Console.WriteLine("Something went wrong in the jumpTree"); break; } // The user is prompted to press any key to continue, ReadKey handles that and then we go back to the recipe menu Console.ReadKey(); displayScreen(); }