public void CheckOut() { PrintMovies(); int movieIndex = InputUtil.ReadInteger("\nWhat movie would you like to watch? ", 1, movies.Count); Movie selectedMovie = movies[movieIndex - 1]; selectedMovie.PrintInfo(); string[] watchMoreYes = { "y", "yes" }; string[] watchMoreNo = { "n", "no" }; bool watchMovieNow = InputUtil.GetInputBool("\nDo you want to watch the movie? Y/N", watchMoreYes, watchMoreNo); if (watchMovieNow) { selectedMovie.Play(); } }
public static void RunApp() { Console.WriteLine("Welcome to GC Blockbuster Lab!\n"); BlockBuster gcbb = new BlockBuster(); bool keepWatching; string[] watchMoreYes = { "y", "yes" }; string[] watchMoreNo = { "n", "no" }; do { gcbb.CheckOut(); keepWatching = InputUtil.GetInputBool("Watch another movie?", watchMoreYes, watchMoreNo); } while (keepWatching); Console.WriteLine("\nThank you and come again!\n"); }
public override void Play() { if (InputUtil.GetInputBoolYesNo("Play entire movie? (y/n)")) { PlayWholeMovie(); return; } bool watchMoreScenes = true; PrintScenes(); while (watchMoreScenes) { int sceneIndex = InputUtil.ReadInteger( $"What scene of the DVD, {title}, would you like to watch? ", 1, scenes.Count); Console.WriteLine($"\tplaying scene {sceneIndex}: {scenes[sceneIndex - 1]}"); string[] watchMoreYes = { "y", "yes" }; string[] watchMoreNo = { "n", "no" }; watchMoreScenes = InputUtil.GetInputBool("Watch another scene?", watchMoreYes, watchMoreNo); } }