Beispiel #1
0
 public void Exercise(RobotPet robotPet)
 {
     robotPet.Performance++;
     robotPet.Oil--;
     robotPet.Boredom--;
     Console.WriteLine($"{robotPet.Name} now has {robotPet.Performance} performance, {robotPet.Oil} oil," +
                       $" and {robotPet.Boredom} boredom.");
 }
Beispiel #2
0
 public void AdoptRobot(RobotPet robotPet)
 {
     listOfRobotPets.Remove(robotPet);
 }
Beispiel #3
0
 public void AddRobotPetToShelter(RobotPet robotPet)
 {
     listOfRobotPets.Add(robotPet);
 }
Beispiel #4
0
 public void TakeToDoctor(RobotPet robotPet)
 {
     robotPet.Performance++;
     Console.WriteLine($"{robotPet.Name}'s performance level is now {robotPet.Performance}");
 }
Beispiel #5
0
 //single robot pet methods
 public void FeedPet(RobotPet robotPet)
 {
     robotPet.Oil--;
     Console.WriteLine($"{robotPet.Name}'s oil level is now {robotPet.Oil}");
 }
Beispiel #6
0
        public void GameplayMenu()
        {
            Console.WriteLine("Welcome to Virtual Pet!!\n");
            do
            {
                OrganicPet organicPet = new OrganicPet();
                RobotPet   robotPet   = new RobotPet();

                shelter.Tick();

                Console.WriteLine("\nPlease type one of the following menu options:\n" +
                                  "\nAdd Pet - add a new pet to the shelter\n" +
                                  "\nPet Status - displays all pets' names species and stats\n" +
                                  "\nFeed Pet - feeds pet, decreasing hunger\n" +
                                  "\n    Feed All - feed all pets\n" +
                                  "\nTake to Doctor - increasing health\n" +
                                  "\n    Take all to Doctor - same as above for all pets\n" +
                                  "\nExercise -increasing health, decreasing boredom, and increasing hunger\n" +
                                  "\n    Exercise All - same as above for all pets\n" +
                                  "\nAdopt - Remove a selected pet from the shelter\n" +
                                  "\nExit - exits the game\n");

                response = Console.ReadLine().ToLower();
                switch (response)
                {
                case "add pet":
                    switch (pet.ChoosePetType())
                    {
                    case "robot":
                        robotPet = robotPet.AddPet();
                        shelter.AddRobotPetToShelter(robotPet);
                        break;

                    case "organic":
                        organicPet.AddPet();
                        shelter.AddOrganicPetToShelter(organicPet);
                        break;
                    }
                    Console.Clear();
                    break;

                case "pet status":
                    shelter.GetStatusAll();
                    break;

                case "feed pet":
                    switch (pet.ChoosePetType())
                    {
                    //robo pet equals choose pet w the shelter
                    case "robot":
                        robotPet = robotPet.ChoosePet(shelter);
                        robotPet.FeedPet(robotPet);
                        break;

                    case "organic":
                        organicPet = organicPet.ChoosePet(shelter);
                        organicPet.FeedPet(organicPet);
                        break;
                    }
                    Console.Clear();
                    break;

                case "feed all":
                    switch (pet.ChoosePetType())
                    {
                    case "robot":
                        robotPet.FeedAll(shelter);
                        break;

                    case "organic":
                        organicPet.FeedAll(shelter);
                        break;
                    }
                    Console.Clear();
                    break;

                case "take to doctor":
                    switch (pet.ChoosePetType())
                    {
                    case "robot":
                        robotPet = robotPet.ChoosePet(shelter);
                        robotPet.TakeToDoctor(robotPet);
                        break;

                    case "organic":
                        organicPet = organicPet.ChoosePet(shelter);
                        organicPet.TakeToDoctor(organicPet);
                        break;
                    }
                    Console.Clear();
                    break;

                case "take all to doctor":
                    switch (pet.ChoosePetType())
                    {
                    case "robot":
                        robotPet.TakeToDoctorAll(shelter);
                        break;

                    case "organic":
                        organicPet.TakeToDoctorAll(shelter);
                        break;
                    }
                    Console.Clear();
                    break;

                case "exercise":
                    switch (pet.ChoosePetType())
                    {
                    case "robot":
                        robotPet = robotPet.ChoosePet(shelter);
                        robotPet.Exercise(robotPet);
                        break;

                    case "organic":
                        organicPet = organicPet.ChoosePet(shelter);
                        organicPet.Exercise(organicPet);
                        break;
                    }
                    Console.Clear();
                    break;

                case "exercise all":
                    switch (pet.ChoosePetType())
                    {
                    case "robot":
                        robotPet.ExerciseAll(shelter);
                        break;

                    case "organic":
                        organicPet.ExerciseAll(shelter);
                        break;
                    }
                    Console.Clear();
                    break;

                case "adopt":
                    switch (pet.ChoosePetType())
                    {
                    case "robot":
                        robotPet = robotPet.ChoosePet(shelter);
                        shelter.AdoptRobot(robotPet);
                        break;

                    case "organic":
                        organicPet = organicPet.ChoosePet(shelter);
                        shelter.AdoptOrganic(organicPet);
                        break;
                    }
                    Console.Clear();
                    break;

                case "exit":
                    playingGame = false;
                    break;

                default:
                    Console.WriteLine("command not recognized");
                    break;
                }
            } while (playingGame);
        }