Exemple #1
0
        public void Execute()
        {
            IAnimal animal = (T)Activator.CreateInstance(typeof(T), new object[] { _name, _age });

            if (_account.CanRemoveFunds(animal.GetPrice()))
            {
                _account.RemoveFunds(animal.GetPrice());
                _animals.Add(animal);
            }
        }
Exemple #2
0
 public void Add(IAnimal animal) => Animals.Add(animal);