示例#1
0
 private void AddWaterClickImpl()
 {
     if (CurrentAmountOfWater < TotalWaterAmount)
     {
         CurrentAmountOfWater += CapacityOfWater;
         SaveWaterToFile.SaveWaterToFileMethod(CurrentAmountOfWater.ToString(), DaysDifference);
     }
 }
示例#2
0
        private void SubWaterClickImpl()
        {
            if (CurrentAmountOfWater > CapacityOfWater)
            {
                CurrentAmountOfWater -= CapacityOfWater;
            }
            else
            {
                CurrentAmountOfWater = 0;
            }

            SaveWaterToFile.SaveWaterToFileMethod(CurrentAmountOfWater.ToString(), DaysDifference);
        }
示例#3
0
        public float CalculateCurrentWaterState()
        {
            float calculation = float.Parse(CurrentAmountOfWater.ToString()) / float.Parse(TotalWaterAmount.ToString());

            if (calculation >= 1.0)
            {
                return(1.0F);
            }
            else
            {
                return(calculation);
            }
        }