Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            string            userSelection;
            string            userPetSelection;
            Pet               myPet        = new Pet();
            OrganicPet        myOrganicPet = new OrganicPet();
            RoboticPet        myRoboticPet = new RoboticPet();
            VirtualPetShelter myShelter    = new VirtualPetShelter();
            bool              exitGame     = false;

            do
            {
                myOrganicPet.PetMenu();
                userSelection = Console.ReadLine();

                switch (userSelection)
                {
                case "1":

                    Console.WriteLine("Please Select whether you want to add an organic pet or a robotic pet: ");
                    Console.WriteLine("1- Organic Pet");
                    Console.WriteLine("2- Robotic Pet");
                    userPetSelection = Console.ReadLine();

                    switch (userPetSelection)
                    {
                    case "1":
                        myPet = new OrganicPet();
                        myPet.AddPet();
                        myShelter.AddPetToShelter(myPet);

                        ScreenClear();
                        break;

                    case "2":
                        myPet = new RoboticPet();
                        myPet.AddPet();
                        myShelter.AddPetToShelter(myPet);

                        /*myRoboticPet = new RoboticPet();
                         * myRoboticPet.AddRoboticPet();
                         * myShelter.AddRoboticPetToShelter(myRoboticPet);*/
                        ScreenClear();
                        break;
                    }
                    break;

                case "2":
                    myShelter.ListPetSelection();
                    myPet = myShelter.SelectPet();
                    Console.WriteLine($"You are now interacting with {myPet.PetName}");
                    ScreenClear();
                    break;

                case "3":
                    myShelter.ShowAllPetsInfo();
                    ScreenClear();
                    break;

                case "4":
                    myShelter.ShowAllPetsStatus();
                    ScreenClear();
                    break;

                case "5":
                    Console.WriteLine("Please select a number from the following: ");
                    Console.WriteLine("1- Feed single pet");
                    Console.WriteLine("2- Feed all pets in shelter");
                    userSelection = Console.ReadLine();
                    ScreenClear();

                    switch (userSelection)
                    {
                    case "1":
                        myPet.FeedPet();
                        break;

                    case "2":
                        myShelter.FeedAllPets();
                        break;
                    }
                    break;

                case "6":
                    Console.WriteLine("Please select a number from the following: ");
                    Console.WriteLine("1- Play with a single pet");
                    Console.WriteLine("2- Play with all pets in shelter");
                    userSelection = Console.ReadLine();
                    ScreenClear();

                    switch (userSelection)
                    {
                    case "1":
                        myPet.PlayWithPet();
                        break;

                    case "2":
                        myShelter.PlayWithAllPets();
                        break;
                    }
                    break;

                case "7":
                    Console.WriteLine("Please select a number from the following: ");
                    Console.WriteLine("1- Take one pet to the doctor");
                    Console.WriteLine("2- Take all pets to the doctor");
                    userSelection = Console.ReadLine();
                    ScreenClear();

                    switch (userSelection)
                    {
                    case "1":
                        myPet.TakeToDoctor();
                        break;

                    case "2":
                        myShelter.TakeAllPetsToDoctor();
                        break;
                    }
                    break;

                case "8":
                    exitGame = true;
                    break;
                }
            } while (exitGame == false);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //Create Virtual Pet


            VirtualPet myCat = new VirtualPet();

            //Create Shelter
            VirtualPetShelter myShelter = new VirtualPetShelter();

            //create menu here
            //menu options here is to add pet to shelter
            string menuChoice  = "";
            bool   userPlaying = true;

            while (userPlaying)
            {
                Console.WriteLine("\nVirtual Pet Menu:");
                Console.WriteLine("1. Add A Pet To Shelter");
                Console.WriteLine("2. Display All My Pets Info");
                Console.WriteLine("3. Display All Pets Status");
                Console.WriteLine("4. Interact With A Pet");
                Console.WriteLine("5. Interact With All Pets");
                Console.WriteLine("6. Exit\n");
                menuChoice = Console.ReadLine();

                switch (menuChoice)
                {
                case "1":
                    myCat = new VirtualPet();
                    myCat.AddPetAndSpecies();
                    myShelter.AddPetToShelter(myCat);
                    break;

                case "2":
                    //Show All Pets Names and Species
                    myShelter.ViewAllPetsInfo();
                    break;

                case "3":
                    //Show Pets Health, Boredom, Hunger
                    myShelter.ViewAllPetsStatus();
                    break;

                case "4":
                    //Interact with 1 pet
                    myShelter.InteractWith1Pet();
                    break;

                case "5":
                    //Interact with All Pets
                    myShelter.InteractWithAllPets();
                    break;

                case "6":
                    //Set isPlaying to False and will exit the program
                    userPlaying = false;

                    break;

                default:
                    break;
                }
            }



            Console.ReadLine();
        }