Exemple #1
0
 public Animal(AnimalType animalType, string name, double weight)
 {
     _animalType = animalType;
     Name        = name;
     Weight      = weight;
 }
Exemple #2
0
 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))));
 }
Exemple #3
0
 public bool IsType(AnimalType animalType)
 {
     return(animalType.Animal == _animalType.Animal);
 }