Beispiel #1
0
        public void AdoptAPet()
        {
            int Id = 1;

            Console.WriteLine("Select a pet to adopt by picking a number :) \n\n");

            foreach (Pets.Vpet pet in pets)
            {
                Console.Write("Pet " + Id + " ");
                pet.ShowInfo();
                Id++;
            }
            Pets.Vpet adoptedPet = pets[Convert.ToInt32(Console.ReadLine()) - 1];

            Console.Clear();
            Console.WriteLine("Your pet was Adopted :) \nPress Any Key To Continue!");
            Console.ReadKey();

            pets.Remove(adoptedPet);
        }
Beispiel #2
0
 public void AddPetToList(Pets.Vpet pet)
 {
     pets.Add(pet);
 }
Beispiel #3
0
 public Pets.Vpet SelectOnePet()
 {
     Console.WriteLine("Select a pet by picking a number :) ");
     Pets.Vpet pet = pets[Convert.ToInt32(Console.ReadLine()) - 1];
     return(pet);
 }
Beispiel #4
0
        public void InGame()
        {
            Pets.RoboPet roboPet = new Pets.RoboPet();
            OrgPet       orgPet  = new OrgPet();

            Pets.Vpet pet = new Pets.Vpet();

            {
                bool userStart = true;

                while (userStart == true)
                {
                    Console.WriteLine("______________________________________________________________________________________________ \n");
                    Console.WriteLine("The Object of the Game is to create a pet, and keep it happy and healthy.                     |\n \nKeep your hunger and boredom levels down, and your health level up!                           |\n");

                    Console.WriteLine("\"E\" To exit            | \"C\" Create pet      | \"A\" Adopt a pet                       |\n");

                    Console.WriteLine("\"SS\" View pet status    | \"F\" Feed pet                | \"P\" Play with Pet                      |\n");

                    Console.WriteLine("\"D\" Care for pet         | \"II\" View shelter pets                                               |\n");

                    Console.WriteLine("\"FF\" Feed shelter pets | \"PP\" Play with shelter pets | \"DD\" Take shelter pets to vet          |");

                    Console.WriteLine("______________________________________________________________________________________________");

                    string menuChoice = Console.ReadLine().ToLower();
                    Console.Clear();


                    if (menuChoice.Equals("e"))
                    {
                        ExitGame();
                    }


                    else if (menuChoice.Equals("c"))
                    {
                        Console.WriteLine("\n Would you like to create a Organic Pet or a Robotic Pet?");
                        Console.WriteLine("\"O\" for an Organic Pet \n Press \"R\" for a Robotic Pet");
                        Console.WriteLine("Press \"E\" to Exit");
                        menuChoice = Console.ReadLine().ToLower();
                        Console.Clear();


                        if (menuChoice.Equals("e"))
                        {
                            Console.Clear();
                            Console.WriteLine("Thanks for playing!!");
                            Console.ReadKey();
                            Environment.Exit(0);
                        }

                        if (menuChoice.Equals("o"))
                        {
                            orgPet = new OrgPet();

                            Console.WriteLine("What kind of Organic pet do you want?");
                            orgPet.Species = Console.ReadLine();
                            Console.WriteLine("What do you want to name your " + orgPet.Species + "?");
                            orgPet.Name = Console.ReadLine();

                            shelter.AddPetToList(orgPet);


                            Console.Clear();
                            Console.WriteLine(" ");
                        }

                        if (menuChoice.Equals("r"))
                        {
                            roboPet = new Pets.RoboPet();

                            Console.WriteLine("What kind of Robotic pet do you want?");
                            roboPet.Species = Console.ReadLine();
                            Console.WriteLine("What do you want to name your " + roboPet.Species + "?");
                            roboPet.Name = Console.ReadLine();

                            shelter.AddPetToList(roboPet);


                            Console.Clear();
                            Console.WriteLine(" ");
                        }
                    }

                    else if (menuChoice.Equals("a"))
                    {
                        Console.Clear();
                        shelter.AdoptAPet();
                        Console.Clear();
                    }

                    else if (menuChoice.Equals("ss"))
                    {
                        shelter.ShowAllPetsStatus();
                    }

                    else if (menuChoice.Equals("ii"))
                    {
                        shelter.ShowAllPetsInfo();
                    }

                    else if (menuChoice.Equals("f"))
                    {
                        Console.Clear();
                        shelter.ShowAllPetsInfo();
                        pet = shelter.SelectOnePet();
                        pet.ShowPetInfoAndStatus();
                        pet.FeedPet();
                        Console.Clear();
                        pet.ShowPetInfoAndStatus();
                    }

                    else if (menuChoice.Equals("ff"))
                    {
                        Console.Clear();
                        shelter.ShowAllInfoAndStatus();
                        shelter.FeedPet();
                        Console.Clear();
                        shelter.ShowAllInfoAndStatus();
                    }

                    else if (menuChoice.Equals("p"))
                    {
                        Console.Clear();
                        shelter.ShowAllPetsInfo();
                        pet = shelter.SelectOnePet();
                        pet.PlayWithPet();
                        Console.Clear();
                        pet.ShowPetInfoAndStatus();
                    }

                    else if (menuChoice.Equals("pp"))
                    {
                        Console.Clear();
                        shelter.ShowAllInfoAndStatus();
                        shelter.PlayWithAll();
                        Console.Clear();
                        shelter.ShowAllInfoAndStatus();
                    }

                    else if (menuChoice.Equals("d"))
                    {
                        Console.Clear();
                        shelter.ShowAllPetsInfo();
                        pet = shelter.SelectOnePet();
                        pet.DrugPet();
                        Console.Clear();
                        pet.ShowPetInfoAndStatus();
                    }

                    else if (menuChoice.Equals("dd"))
                    {
                        Console.Clear();
                        shelter.ShowAllInfoAndStatus();
                        shelter.VetPets();
                        shelter.ShowAllInfoAndStatus();
                    }

                    shelter.LowerAllStats();
                }
            }
        }