示例#1
0
        public void Consume(Drink drink, DateTime currTime)
        {
            mConsumed.Add(drink);
            mCaloriesDrank += drink.mCalories;

            UpdateBAC(currTime);

            // divide the percentage[0,100] by 100 to go to [0,1]
            float drinkAlOz = drink.mVolumeInOunces * drink.mPercentAlchohol / 100.0f;
            mOuncesOfAlchoholInSystem += drinkAlOz;

            mHasStartedDrinking = true;
            mLastUpdateTime = currTime;
        }
示例#2
0
 public float DrinkBACPrediction(Drink drink)
 {
     // divide the percentage[0,100] by 100 to go to [0,1]
     float drinkAlOz = drink.mVolumeInOunces * drink.mPercentAlchohol / 100.0f;
     return AlchoholToBAC(drinkAlOz);
 }