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; }
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); }