static void Menu(Shelter myshelter) { Console.WriteLine("\t\t\tHello! Welcome to Virtual Pets, Inc. \n\n\t\tA virtual interactive full spectrum pet experience"); Console.WriteLine(""); Console.WriteLine("\n\t\t SELECT FROM THE OPTIONS BELOW TO START GAME\n"); Console.WriteLine("\t\tPress 1 to create your a new pet to add to shelter"); Console.WriteLine("\t\tPress 2 to view available pets in shelter"); Console.WriteLine("\t\tPress 0 to quit"); bool running = true; while (running) { string userInput = Console.ReadLine(); switch (userInput) { case "1": //Add Pet in shelter Console.Clear(); Console.WriteLine("\t\t\t\t Create your new pet"); Console.Write("\nWhat would you like to name your pet? "); string name = Console.ReadLine(); Console.Write("How old is your pet? "); int age = Convert.ToInt32(Console.ReadLine()); Console.Write("What species is your pet? "); string species = Console.ReadLine(); myshelter.Add(name, age, species); Console.WriteLine(); Console.Clear(); Console.WriteLine("\t\tCongratulations!\n\nYou have created " + name + " the " + species + "\n\n"); Console.WriteLine("We have moved " + name + " to our shelter"); Console.WriteLine("\n \n----Please select from the options below to continue----"); Console.WriteLine("\npress 2 to go to shelter and interact with the pets"); Console.WriteLine("press 0 to quit"); break; case "2": //View the whole shelter Console.Clear(); Console.WriteLine("\n\t\t\tVirtual Pets, Inc. Shelter\n\t\t\tTerminal Tower, Cleveland\n"); myshelter.Print_List(); options(); break; case "3": //Pet Selector Console.WriteLine("Please type ID to select your pet"); int id = Convert.ToInt32(Console.ReadLine()); myshelter.Select_Pet(id); Console.Clear(); Console.WriteLine("You have selected " + myshelter.Select_Pet(id).Name + ". What would you like to do with " + myshelter.Select_Pet(id).Name + "?"); Submenu(myshelter.Select_Pet(id)); break; case "4": //Adopts pet from Shelter (removes from list) Console.Clear(); Console.WriteLine("\n\t\t\tVirtual Pets, Inc. Shelter\n\t\t\tTerminal Tower, Cleveland\n"); myshelter.Print_List(); Console.WriteLine("\nPlease type ID of the pet you wish to adopt"); int ID = Convert.ToInt32(Console.ReadLine()); Console.Clear(); Console.WriteLine("Congratulations on adopting your new pet\n"); Console.WriteLine("Press 2 to return to the shelter\nPress 0 to leave game and go enjoy your new pet!"); myshelter.Adopt(ID); break; case "5": //feeds all pets Console.Clear(); myshelter.FeedAll(); Console.WriteLine("\n\t\t\tVirtual Pets, Inc. Shelter\n\t\t\tTerminal Tower, Cleveland\n"); myshelter.Print_List(); Console.WriteLine("\nYou fed the whole Shelter"); Console.WriteLine("\nPress 2 to see interaction memu again"); break; case "6": //play with all of them Console.Clear(); Console.WriteLine("\n\t\t\tVirtual Pets, Inc. Shelter\n\t\t\tTerminal Tower, Cleveland\n"); myshelter.Print_List(); Console.WriteLine("\nYou played with the whole Shelter"); myshelter.Playwithall(); Console.WriteLine("\nPress 2 to see interaction memu again"); break; case "7": //took all pets to technician Console.Clear(); myshelter.Checkup(); Console.WriteLine("\n\t\t\tVirtual Pets, Inc. Shelter\n\t\t\tTerminal Tower, Cleveland\n"); myshelter.Print_List(); Console.WriteLine("\nYou took all the pets for a check-up"); Console.WriteLine("\nPress 2 to see interaction memu again"); break; case "0": //Close the program running = false; break; default: Console.WriteLine("You selected an invaild response please select 1 thru 7 to continue or 0 to exit game"); break; } myshelter.TickAllOfThem(); } }
static void Menu(Shelter myshelter) { Console.WriteLine("Hello! Welcome to Virtual Pets, Inc. Here we have created a virtual interactive full spectrum pet experience."); Console.WriteLine(""); Console.WriteLine("\nplease select from the options below."); Console.WriteLine("\n\t\t\t======== Main_Menu ========"); Console.WriteLine("\t\t\tPress 1 to create your a pet "); Console.WriteLine("\t\t\tPress 2 to view available pets in shelter"); Console.WriteLine("\t\t\tPress 4 to feed all of the pets in the shelter"); Console.WriteLine("\t\t\tPress 5 to Adopt pet from the shelter"); Console.WriteLine("\t\t\tPress 0 to quit"); bool running = true; while (running) { string userInput = Console.ReadLine(); switch (userInput) { case "1": //Create your pet Console.WriteLine("\t\t\t\t Create your pet"); Console.Write("\nWhat would you like to name your pet? "); string name = Console.ReadLine(); Console.Write("How old is your pet? "); int age = Convert.ToInt32(Console.ReadLine()); Console.Write("What species is your pet? "); string species = Console.ReadLine(); myshelter.Add(name, age, species); Console.WriteLine(); Console.Clear(); Console.WriteLine("Congratulations!\n\nYou have created " + name + " the " + species + " who is " + age + " years old. \n\n"); Console.WriteLine("We have moved " + name + " to our shelter"); Console.WriteLine("\n \n----Please select from the options below to continue----"); Console.WriteLine("\npress 2 to view all the animals in our shelter"); Console.WriteLine("press 0 to quit"); break; case "2": //View the whole shelter Console.Clear(); Console.WriteLine("\nView list of available pets in shelter \n"); myshelter.Print_List(); Console.WriteLine("\n\nPress 3 to select a pet to interact with"); break; case "3": Console.WriteLine("Please type ID to select your pet"); //Pet Selector int id = Convert.ToInt32(Console.ReadLine()); myshelter.Select_Pet(id); Console.Clear(); Console.WriteLine("You selected " + myshelter.Select_Pet(id).Name + ". " + myshelter.Select_Pet(id).Age + " years old "); Submenu(myshelter.Select_Pet(id)); break; case "4": Console.Clear(); myshelter.FeedAll(); Console.WriteLine("You fed the whole Shelter"); Console.WriteLine("Press 2 to return to the shelter"); break; case "5": //Adopt a pet from the shelter myshelter.Print_List(); Console.WriteLine("Please type ID of the pet you wish to adopt"); int ID = Convert.ToInt32(Console.ReadLine()); Console.Clear(); Console.WriteLine("Congratulations on your new adoption."); Console.WriteLine("Press 2 to return to the shelter"); myshelter.Adopt(ID); break; case "0": //Close the program running = false; break; default: Console.WriteLine("You pressed wrong number"); break; } myshelter.TickAllOfThem(); } }