public void AddPet(String petName, Constants.PET_TYPE petType, Constants.SPECIES_TYPE speciesType) { if (petType == Constants.PET_TYPE.INORGANIC) { this.containedPets.Add(new PetRobot(petName, speciesType)); } else { this.containedPets.Add(new PetOrganic(petName, speciesType)); } Console.WriteLine("Pet was successfully added: " + petName); }
private static void AddNewPet() { Console.WriteLine("Please enter the pets name"); String petName = Console.ReadLine(); Console.WriteLine("Please enter the pet type: [0] cat, [1] dog"); int species = int.Parse(Console.ReadLine()); Constants.SPECIES_TYPE speciesType = (Constants.SPECIES_TYPE)species; Console.WriteLine("Do you want a living or robotic pet? Enter : [0] organic, [1] inorganic"); int organicInorganicChoice = int.Parse(Console.ReadLine()); Constants.PET_TYPE petType = (Constants.PET_TYPE)organicInorganicChoice; PetShelters.DefaultShelter.AddPet(petName, petType, speciesType); Console.WriteLine("You created a new pet: " + petName); }
public void SetSpecies(Constants.SPECIES_TYPE newSpecies) { this.Species = newSpecies; }
public Pet(String petName, Constants.SPECIES_TYPE speciesType) { this.Name = petName; this.Species = speciesType; }
public PetOrganic(String petName, Constants.SPECIES_TYPE species) : base(petName, species) { LevelHunger = 50; LevelBoredom = 60; LevelHealth = 30; }
public PetRobot(String petName, Constants.SPECIES_TYPE species) : base(petName, species) { LevelOil = 100; LevelPerformance = 100; LevelMaintenance = 100; }