Ejemplo n.º 1
0
        public void GameStart(PetShelter shelter)
        {
            pet = shelter.Pets[shelter.CurrentPet];
            Console.ReadKey();
            animation.Lights();
            animation.Lights();
            Console.Clear();
            Console.WriteLine();
            Console.WriteLine("Welcome to");
            animation.Title();
            Console.WriteLine("Press ENTER to create your first pet.");
            Console.ReadKey();
            Console.Clear();

            bool run = true;

            do
            {
                Console.WriteLine("Please name your new pet.");
                pet.Name = Console.ReadLine();
                if (pet.Name.Length < 1)
                {
                    Console.Clear();
                    continue;
                }
                Console.Clear();
                Console.WriteLine("What species is your new pet?");
                Console.WriteLine("1. Dog");
                Console.WriteLine("2. Cat");
                Console.WriteLine();
                string speciesChoice = Console.ReadLine();

                switch (speciesChoice)
                {
                case "1":
                    pet.Species = "Dog";
                    run         = false;
                    break;

                case "2":
                    pet.Species = "Cat";
                    run         = false;
                    break;

                default:
                    Console.WriteLine("Please choose either a dog or cat. Press ENTER to try again.");
                    Console.ReadKey();
                    Console.Clear();
                    break;
                }
            } while (run);

            Console.Clear();
            Console.WriteLine("Congratulations! Your new pet " + pet.Species + ", " + pet.Name + ", is ready to go!");
            Console.WriteLine("Press ENTER to go to the main menu.");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public static void MainMenu(PetShelter shelter)
        {
            shelter.pet.Decay();
            Console.Clear();
            Console.WriteLine("Current Pet:  " + shelter.pet.Name);
            Console.WriteLine("Shelter status: " + shelter.ShelterCleanStatus());
            Console.ForegroundColor = ConsoleColor.White;
            Console.BackgroundColor = ConsoleColor.Black;
            Console.WriteLine("Shelter dirtiness: " + shelter.DirtinessLevel);
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("========= MAIN MENU =========");
            Console.WriteLine("1. Interact with " + shelter.pet.Name);
            Console.WriteLine("2. Display " + shelter.pet.Name + "'s Information");
            Console.WriteLine("3. Display " + shelter.pet.Name + "'s Status");
            Console.WriteLine("4. Display Information for All Pets");
            Console.WriteLine("5. Interact with All Pets");
            Console.WriteLine("6. Display Status of All Pets");
            Console.WriteLine("7. Switch Current Pet");
            Console.WriteLine("8. Create New Pet");
            Console.WriteLine("9. Remove a Pet from the Shelter.");
            Console.WriteLine("10. Clean cages.");
            Console.WriteLine("0. Quit Game");

            string menuSelection = Console.ReadLine();

            switch (menuSelection)
            {
            case "1":
                if (shelter.DirtinessLevel >= 90)
                {
                    Console.Clear();
                    Console.WriteLine();
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Shelter is too dirty. Can't interact with pets.");
                    Console.WriteLine("Please clean shelter first.");
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.WriteLine();
                    Console.WriteLine("Press any key to go back to main menu");
                    Console.ReadKey();
                    MainMenu(shelter);
                }
                shelter.pet.PetInteractions(shelter);
                break;

            case "2":
                shelter.pet.ShowInfo();
                MainMenu(shelter);
                break;

            case "3":
                shelter.pet.ShowStatus();
                MainMenu(shelter);
                break;

            case "4":
                shelter.AllPets();
                MainMenu(shelter);
                break;

            case "5":
                if (shelter.DirtinessLevel >= 90)
                {
                    Console.Clear();
                    Console.WriteLine("Shelter is too dirty. Can't interact with pets. Please clean cages first!");
                    Console.WriteLine();
                    Console.WriteLine("Press any key to go back to main menu");
                    Console.ReadKey();
                    MainMenu(shelter);
                }
                shelter.AllInteract();
                MainMenu(shelter);
                break;

            case "6":
                Console.Clear();
                shelter.AllStatus();
                MainMenu(shelter);
                break;

            case "7":
                shelter.SwitchCurrentPet();
                MainMenu(shelter);
                break;

            case "8":
                shelter.CreatePet();
                MainMenu(shelter);
                break;

            case "9":
                shelter.RemovePet();
                MainMenu(shelter);
                break;

            case "10":
                shelter.CleanCages();
                MainMenu(shelter);
                break;

            case "0":
                Environment.Exit(0);
                break;

            default:
                Console.Write("Please enter a valid selection. Press ENTER to try again.");
                Console.ReadKey();
                MainMenu(shelter);
                break;
            }
        }
Ejemplo n.º 3
0
        public override void PetInteractions(PetShelter shelter)
        {
            Console.Clear();

            Decay();
            Console.WriteLine("What would you like to do with " + Name + "?");
            Console.WriteLine("1. Oil Pet");
            Console.WriteLine("2. Charge Battery");
            Console.WriteLine("3. Cooldown");
            Console.WriteLine("0. Go Back to Main Menu");

            string interactionSelection = Console.ReadLine();

            switch (interactionSelection)
            {
            case "1":
                Console.Clear();
                Console.WriteLine("You gave " + Name + " some oil.");
                Console.WriteLine(Name + " is functioning properly.");
                OilChange();
                shelter.CageDecay();
                Console.WriteLine();
                Console.WriteLine(Name + "'s Oil Level is now " + OilLevel);
                Console.WriteLine("Press ENTER to continue.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;

            case "2":
                Console.Clear();
                Console.WriteLine("You plugged " + Name + " in for a charge.");
                ChargeBattery();
                Console.WriteLine();
                Console.WriteLine(Name + "'s Battery Level is now: " + BatteryLevel);
                Console.WriteLine("Press ENTER to continue.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;

            case "3":
                Console.Clear();
                Console.WriteLine("You cooled off " + Name);
                CoolDown();
                Console.WriteLine();
                Console.WriteLine(Name + " is now cooled off!");
                Console.WriteLine("Press ENTER to continue.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;

            case "0":
                Menu.MainMenu(shelter);
                break;

            default:
                Console.WriteLine("Please enter a valid selection. Press ENTER to try again.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;
            }
        }
Ejemplo n.º 4
0
        public override void PetInteractions(PetShelter shelter)
        {
            Console.Clear();

            Decay();
            Console.WriteLine("What would you like to do with " + Name + "?");
            Console.WriteLine("1. Play");
            Console.WriteLine("2. Feed");
            Console.WriteLine("3. Sleep");
            Console.WriteLine("4. Take to Bathroom");
            Console.WriteLine("5. Give Water");
            Console.WriteLine("0. Go Back to Main Menu");

            string interactionSelection = Console.ReadLine();

            switch (interactionSelection)
            {
            case "1":
                Console.Clear();
                Console.WriteLine("You took " + Name + " out to the park!");
                Console.WriteLine(Name + " had a great time!");
                Play();
                Console.WriteLine();
                Console.WriteLine(Name + "'s Boredom is now: " + Boredom);
                Console.WriteLine("Press ENTER to continue.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;

            case "2":
                Console.Clear();
                Console.WriteLine(Name + " devoured its food!");
                Feed();
                Console.WriteLine();
                Console.WriteLine(Name + "'s Hunger is now: " + Hunger);
                Console.WriteLine("Press ENTER to continue.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;

            case "3":
                Console.Clear();
                Console.WriteLine("Zzzzzzzzzzzzzzzzzzz. " + Name + " is taking a nap...");
                Rest();
                Console.WriteLine();
                Console.WriteLine(Name + " is now fully rested!");
                Console.WriteLine("Press ENTER to continue.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;

            case "4":
                Console.Clear();
                Console.WriteLine(Name + " sniffs around...");
                Console.WriteLine(Name + " left a mess!");
                Poop();
                shelter.CageDecay();
                Console.WriteLine();
                Console.WriteLine(Name + " successfully relieved itself!");
                Console.WriteLine("Press ENTER to continue.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;

            case "5":
                Console.Clear();
                Console.WriteLine(Name + " drinks some water!");
                Drink();
                Console.WriteLine(Name + " looks pleased!");
                Console.WriteLine();
                Console.WriteLine(Name + "'s thirst is now: " + Thirst);
                Console.WriteLine("Press ENTER to continue.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;

            case "0":
                Menu.MainMenu(shelter);
                break;

            default:
                Console.WriteLine("Please enter a valid selection. Press ENTER to try again.");
                Console.ReadKey();
                PetInteractions(shelter);
                break;
            }
        }
        static void MainMenu()
        {
            PetShelter myShelter   = new PetShelter();
            Menu       graphicMenu = new Menu();

            bool run = true;

            do
            {
                List <string> mainMenuItemsList = new List <string>()
                {
                    "CREATE A PET",
                    "QUIT"
                };

                if (myShelter.PetsList.Count > 0)
                {
                    mainMenuItemsList.Insert(mainMenuItemsList.Count - 1, "DISPLAY PETS' INFO");
                    mainMenuItemsList.Insert(mainMenuItemsList.Count - 1, "DISPLAY PETS' STATS");
                    mainMenuItemsList.Insert(mainMenuItemsList.Count - 1, "INTERACT WITH PETS");
                    mainMenuItemsList.Insert(mainMenuItemsList.Count - 1, "REMOVE A PET");
                }

                myShelter.TimeEffectAll();

                switch (graphicMenu.VisualMenu(mainMenuItemsList, "Main Menu"))
                {
                case 1:
                    Console.WriteLine("\n\nPet Creation:");
                    myShelter.CreateNewPet();
                    break;

                case 2:
                    if (myShelter.PetsList.Count > 0)
                    {
                        myShelter.DisplayAllPetsInfo();
                    }
                    else
                    {
                        Console.WriteLine("\nSee you next time, friend.");
                        run = false;
                    }
                    break;

                case 3:
                    myShelter.DisplayAllPetsStats();
                    break;

                case 4:
                    myShelter.TypeSelectionMenu();
                    break;

                case 5:
                    myShelter.RemovePet();
                    break;

                default:
                    Console.WriteLine("\nSee you next time, friend.");
                    run = false;
                    break;
                }
            } while (run);
        }
Ejemplo n.º 6
0
 public abstract void PetInteractions(PetShelter shelter);