public Animal(AnimalType animalType, string name, double weight) { _animalType = animalType; Name = name; Weight = weight; }
private static double CalculateCost(IEnumerable <Animal> animals, AnimalType type, Prices prices) { return(animals.Where(animal => animal.IsType(type)) .Aggregate(0.0, ((cost, animal) => cost + animal.CalculatePrice(prices)))); }
public bool IsType(AnimalType animalType) { return(animalType.Animal == _animalType.Animal); }