static void Main(string[] args) { Console.WriteLine("Welcome to Blockbuster."); Blockbuster lastAlaskanBlockbuster = new Blockbuster(); lastAlaskanBlockbuster.CheckOut(); }
//METHODS public override void Play() { for (int i = 0; i < Scenes.Count; i++) { Console.WriteLine(Scenes[CurrentTime]); Thread.Sleep(4000); CurrentTime++; if (i < Scenes.Count - 1 && Blockbuster.AskYesOrNo("Keep watching?")) { continue; } else { break; } } if (Blockbuster.AskYesOrNo($"Would you like to watch {Title} again?")) { if (RunTime == 0) { Play(); } else if (RunTime != 0) { if (Blockbuster.AskYesOrNo($"Would you like to rewind {Title} first?")) { CurrentTime = 0; } else { if (RunTime < Scenes.Count) { Play(); } if (RunTime >= Scenes.Count + 1) { for (int i = 0; i <= 2; i++) { Console.WriteLine("CREDITS ROLL"); Thread.Sleep(3000); } Console.WriteLine("FBI WARNING"); Thread.Sleep(2000); Console.Write("*ps"); for (int i = 0; i < 1000; i++) { Console.Write("h"); Thread.Sleep(25); } Console.Write("h*\n"); Thread.Sleep(2000); } } } } }
public void CheckOut() { bool loop = true; while (loop) { PrintMovies(); Console.WriteLine("Which movie would you like to check out?"); string regEx = "\\b[1-" + $"{inventory.Count}" + "]\\b"; if (Blockbuster.ValidationLoop("a movie index", regEx, out int inventoryIndex)) { Console.WriteLine($"\nYou have selected {inventory[inventoryIndex - 1].Title}.\n"); } try { inventory[inventoryIndex - 1].PrintInfo(); } catch (IndexOutOfRangeException e1) { inventoryIndex = 1; Console.WriteLine(e1.Message); } catch (Exception e2) { inventoryIndex = 1; Console.WriteLine(e2.Message); } if (AskYesOrNo($"\nWould you like to watch {inventory[inventoryIndex - 1].Title}?\n")) { inventory[inventoryIndex - 1].Play(); } else { Console.WriteLine("We're almost out of that movie, anyway."); } if (AskYesOrNo("Would you like to check out another movie?")) { loop = true; } else { loop = false; } } Console.WriteLine("Thanks for visiting this relic of a bygone era. Take some CBD on your way out."); }
public override void Play() { Console.WriteLine("\nWhat scene would you like to watch?\n"); int i = 1; foreach (string scene in Scenes) { Console.WriteLine($"Scene {i}:\n{scene}\n"); i++; } string regEx = "\\b[1-" + $"{Scenes.Count}" + "]\\b"; //Console.WriteLine($"Scene number regular expression is \"{regEx}\"."); if (Blockbuster.ValidationLoop("which scene you would like to watch", regEx, out int sceneNumber)) { Console.WriteLine($"Scene {sceneNumber}:\n {Scenes[sceneNumber-1]}"); } if (Blockbuster.AskYesOrNo($"\nWould you like to watch another scene from {Title}?")) { Play(); } }