示例#1
0
        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 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);
            }
        }