Example #1
0
        private void AddFertilizerToSoil(int week, decimal fertilizerAmount)
        {
            //Need to add costs
            //Get the Nutrition from the week before
            if (week != 0)
            {
                plotWeeks[week].SoilNutrition = plotWeeks[week - 1].SoilNutrition;
            }
            // Calculate the Nutrition Lose Rate
            plotWeeks[week].SoilNutrition -= soiltype.GetNutritionLoseRate();


            //Add Water Amount
            plotWeeks[week].SoilNutrition += fertilizerAmount;
            if (plotWeeks[week].SoilNutrition > soiltype.GetMaximumNutrition())
            {
                plotWeeks[week].SoilNutrition = soiltype.GetMaximumNutrition();
            }
        }