Пример #1
0
        public override void DoService(IAnimal animal, int procedureTime)
        {
            base.DoService(animal, procedureTime);
            animal.AddHappiness(12);
            animal.AddEnergy(10);

            this.AddAnimal(animal);
        }
Пример #2
0
 public override void DoService(IAnimal animal, int procedureTime)
 {
     if (animal.ProcedureTime >= procedureTime)
     {
         animal.ReduceEnergy(6);
         animal.AddHappiness(12);
         animal.DecreaseProcedureTime(procedureTime);
         this.AddToHistory((Animal)animal);
     }
     else
     {
         throw new ArgumentException("Animal doesn't have enough procedure time");
     }
 }