private const double _B60 = 0.15; //это не изменяющийся параметр, показывающий кол-во промилле выводящееся за час из организма public List <double?> TimeToClean(Alcohol alcohol, User user) { List <double?> hours = new List <double?>(); List <double?> concs = Volumes(alcohol, user); foreach (var item in concs) { hours.Add(item / _B60); } return(hours); }
public List <double?> Volumes(Alcohol alcohol, User user) { List <double?> concs = new List <double?>(); foreach (var item in conditions) { var c = item.Concentration; var A = c * user.Weight * user.WidmarK; concs.Add(A); } return(concs); }
public void Volumes(Alcohol alcohol, User user) { foreach (var item in conditions) { var c = item.Concentration; var k = alcohol.AlcoholicBeverage; var A = (c * user.Weight * user.WidmarK * 100) / (k * _density * 0.7); var hours = c / _B60; var step1 = userConditions.Find(i => i.Name == item.Name); step1.Volume = Convert.ToInt32(A); step1.Hours = Convert.ToInt32(hours); } }