static void Main(string[] args) { VirtualPetShelter grovewood = new VirtualPetShelter(); Manager karen = new Manager("2/10/2010", "Volunteer", "Karen", 0020, "Manager", "02/06/2008"); Volunteer joseph = new Volunteer("Joseph", 200, "Volunteer", "08/17/2017", 20, "Volunteer Inc"); bool gameOn = true; string[] employeeArray = new string[] { "1. Shelter Manager", "2. Shelter Volunteer" }; string[] managerChoiceArray = new string[] { "1. Play", "2. Adopt", "3. Take to doctor", "4. Lay down for a Nap", "5. Exit" }; string[] volunteerChoiceArray = new string[] { "1. Feed", "2. Give Water", "3.Play", "4. Take to doctor", "5. Lay down for a Nap", "6. Exit" }; while (gameOn == true) { int employeeValue = 0; Console.WriteLine("Welcome to the Grovewood Magical Shelter! What kind of employee are you?"); for (int i = 0; i < employeeArray.Length; i++) { Console.WriteLine(employeeArray[i]); } employeeValue = int.Parse(Console.ReadLine()); switch (employeeValue) { case 1: bool managerMode = true; while (managerMode == true) { Console.WriteLine("Good Morning {0}", karen.Name); karen.ShopTimer(grovewood); Console.WriteLine("This is the Status of Your pets"); foreach (var item in grovewood.PetRoster) { Console.WriteLine(""); Console.WriteLine("Name: {0}", item.Name); Console.WriteLine("Hunger: {0}", item.Hunger); Console.WriteLine("Boredom: {0}", item.Boredom); Console.WriteLine("Tiredness: {0}", item.Tired); Console.WriteLine("Sickness: {0}", item.Sickness); Console.WriteLine(""); } Console.WriteLine("What would you like to do today?"); for (int i = 0; i < managerChoiceArray.Length; i++) { Console.WriteLine(managerChoiceArray[i]); } int managerChoice = int.Parse(Console.ReadLine()); switch (managerChoice) { case 1: karen.Play(grovewood); break; case 2: /*karen.Adopt();*/ //had some issues with this one break; case 3: karen.DoctorVisit(grovewood); break; case 4: karen.Sleep(grovewood); break; case 5: managerMode = false; break; default: Console.WriteLine("I'm sorry, you entered an unknown choice, please try again."); break; } } break; case 2: bool volunteerMode = true; while (volunteerMode == true) { Console.WriteLine("Good Morning {0}", joseph.Name); karen.ShopTimer(grovewood); Console.WriteLine("This is the Status of Your pets"); foreach (var item in grovewood.PetRoster) { Console.WriteLine(""); Console.WriteLine("Name: {0}", item.Name); Console.WriteLine("Hunger: {0}", item.Hunger); Console.WriteLine("Boredom: {0}", item.Boredom); Console.WriteLine("Tiredness: {0}", item.Tired); Console.WriteLine("Sickness: {0}", item.Sickness); Console.WriteLine(""); } Console.WriteLine("What would you like to do today?"); for (int i = 0; i < volunteerChoiceArray.Length; i++) { Console.WriteLine(managerChoiceArray[i]); } int managerChoice = int.Parse(Console.ReadLine()); switch (managerChoice) { case 1: joseph.FeedPets(grovewood); foreach (var item in grovewood.PetRoster) { Console.WriteLine("You fed {0} their favorite meal! {1}!", item.Name, item.Diet); } break; case 2: joseph.Water(grovewood); break; case 3: joseph.Play(grovewood); break; case 4: joseph.DoctorVisit(grovewood); break; case 5: joseph.Sleep(grovewood); break; case 6: volunteerMode = false; break; default: Console.WriteLine("I'm sorry, you entered an unknown choice, please try again."); break; } } break; default: break; } } }
static void Main(string[] args) { //DECLARED MISC VARIABLES FOR NEATNESS SAKE ConsoleKeyInfo keyselect; bool quit = true; string relay; //declaring class instances for the pets VirtualPetShelter shelter = new VirtualPetShelter("Funny Farm"); Big_Dog carl = new Big_Dog("carl"); Big_Dog hardee = new Big_Dog("hardee"); SmallDog carlsjr = new SmallDog("carlsjr"); SmallDog hardeesjr = new SmallDog("hardeesjr"); shelter.PetAdd(carl); // adding them to the list in VirtualPetShelter as required shelter.PetAdd(hardee); shelter.PetAdd(carlsjr); shelter.PetAdd(hardeesjr); //UI START // TITLE CARD Console.WriteLine("Welcome to the Virtual Pet Shelter Control Console TM. \n Press any key to begin."); Console.ReadKey(); do { Console.Clear(); Console.WriteLine("Which Type of user are you? \n [1] VOLUNTEER \n [2] MANAGER \n SELECT AN OPTION OR PRESS Q TO QUIT"); keyselect = Console.ReadKey(); switch (keyselect.KeyChar) { // VOLUNTEER CODE case '1': Console.Clear(); Console.WriteLine("What is your Name?"); relay = Console.ReadLine(); Console.WriteLine("What is your specialty \n [1] Feeding \n [2] Watering \n [3] Entertaining"); keyselect = Console.ReadKey(); Volunteer volun = new Volunteer(relay, keyselect.KeyChar); // declaring volunteer class with name and expertise input shelter.ShelterEmployee.Add(volun); do // prints out the pet status { Console.Clear(); Console.WriteLine("Welcome {0} the current pets availible are:", volun.Name); Console.WriteLine("Name: HungerLVL ThirstLVL BoredomLVL"); foreach (VirtualPet pet in shelter.ShelterPets) // prints the list of pets and their status { Console.Write(pet.Name); for (int i = 0; i < 9 - pet.Name.Length; i++) // this loop makes the ui look cool and spaced evenly while in double digits at least { Console.Write(" "); } Console.WriteLine(" {0} {1} {2}", pet.Hunger, pet.Thirst, pet.Boredom); } // ACTIONS CHOICE FOR VOLUNTEER Console.WriteLine("\n \n \n What action would you like to partake"); Console.WriteLine(" [1] Feed All Pets \n [2] Water All Pets \n [3] Play With a Pet \n [4] Go back"); keyselect = Console.ReadKey(); switch (keyselect.KeyChar) { case '1': // feed volun.Feed(shelter); break; case '2': // water volun.Water(shelter); break; case '3': // play do { int counter = 1; Console.WriteLine("Which pet do you want to play with?"); foreach (VirtualPet pet in shelter.ShelterPets) // loop to display names and number to select { Console.WriteLine(" [{0}] {1}", counter, pet.Name); counter++; } keyselect = Console.ReadKey(); // input for play select }while (KeyCheck(keyselect.KeyChar)); volun.Play(shelter, (int)Char.GetNumericValue(keyselect.KeyChar)); break; // break for play case '4': quit = false; break; } } while (quit); quit = true; Console.WriteLine("test"); break; // volunteer break // MANAGER CODE case '2': Manager manager = new Manager("Darren"); shelter.ShelterEmployee.Add(manager); // PET STATUS DISPLAY do { Console.Clear(); Console.WriteLine("Welcome Manager the current pets availible are:"); Console.WriteLine("Name: HungerLVL ThirstLVL BoredomLVL"); foreach (VirtualPet pet in shelter.ShelterPets) // prints the list of pets and their status { Console.Write(pet.Name); for (int i = 0; i < 9 - pet.Name.Length; i++) // this loop makes the ui look cool and spaced evenly while in double digits at least { Console.Write(" "); } Console.WriteLine(" {0} {1} {2}", pet.Hunger, pet.Thirst, pet.Boredom); } Console.WriteLine("\n \n \n What action would you like to partake"); Console.WriteLine(" [1] Feed All Pets \n [2] Water All Pets \n [3] Play With all Pets \n [4] Adopt \n [5] Go Back"); keyselect = Console.ReadKey(); switch (keyselect.KeyChar) { case '1': manager.Feed(shelter); break; case '2': manager.Water(shelter); break; case '3': manager.Play(shelter, 0); break; case '4': int counter = 0; Console.WriteLine("Which pet would you like to adopt out? \n Current Pets Availible:"); foreach (VirtualPet pet in shelter.ShelterPets) { counter++; Console.WriteLine("[{0}] {1} - {2}", counter, pet.Name, pet.Description); } Console.WriteLine("enter selection number and press enter"); manager.Adopt(shelter, int.Parse(Console.ReadLine())); break; case '5': quit = false; break; default: break; } }while (quit); quit = true; break; // MANAGER BREAK case 'q': //QUIT CODE quit = false; break; default: // nothing break; } }while (quit); } // main