Exemple #1
0
        public override float CalculateRequiredFood()
        {
            // calculate the maximum amount of years to base food on
            var years = Math.Min(MaximumFoodYears, Age.AsYears());

            // food is in kilograms
            var requiredFood = BaseFoodRequirement * years;

            return(requiredFood);
        }
Exemple #2
0
        public override float CalculateRequiredFood()
        {
            // calculate the maximum amount of years to base food on
            var years = Math.Min(MaximumFoodYears, Age.AsYears());

            // calculate the factor to multiply weight with
            var factor = InitialFoodFactor - (FactorMinusPerYear * years);

            var requiredFood = Weight * factor;

            return(requiredFood);
        }