//lists movies and prompts removal by number in the list public void RemoveMovie() { string loneDeletePrompt = "Remove the only remaining movie?(Y/N)", deletePrompt = "Are you sure you want to delete the movie (Y/N)?", listPrompt = "Remove which movie?(1-" + (movies.Count) + ")"; PrintMoviesTitle(); if (movies.Count > 1) { int movieNumber = InputChecker.PromptFromRange(listPrompt, 1, movies.Count); --movieNumber; //OFFSET BY -1 FOR LIST if (InputChecker.PromptYesNo(deletePrompt)) { movies.RemoveAt(movieNumber); Console.WriteLine($"{movies[movieNumber].GetTitle()} deleted"); } else { Console.WriteLine("Canceled"); } } else { if (InputChecker.PromptYesNo(loneDeletePrompt)) { Console.WriteLine($"{movies[0].GetTitle()} deleted"); movies.RemoveAt(0); } else { Console.WriteLine("Canceled"); } } }
//add functionality later, right now being used to imitate not using a list public void EditMovie() { //just for imitation, should just return an error message if (movies.Count == 0) { AddMovie(); } else { movies[0].SetInfo(); } //select from list if (movies.Count > 1) { string listPrompt = "Edit which movie?"; PrintMoviesTitle(); int movieNumber = InputChecker.PromptFromRange(listPrompt, 1, movies.Count); --movieNumber; //OFFSET BY -1 FOR LIST if (InputChecker.PromptYesNo($"Edit {movies[movieNumber].GetTitle()}")) { movies[movieNumber].SetInfo(); } else { Console.WriteLine("Canceled"); } } }
void SetLength() { string userPrompt = "Enter optional length in mins:"; length = InputChecker.PromptFromRange(userPrompt, 0, Int32.MaxValue, 0); }