Beispiel #1
0
        public double getCaloriesValue()
        {
            // every pizza has a dough
            IngridientsInfo.Ingridient dough = IngridientsInfo.GetInfoAbout("Dough");
            double result = dough.carbohydrates * 4 + dough.fats * 4 + dough.carbohydrates * 9;

            result *= Weight / 100;

            foreach (AdditionalIngredients item in additionals)
            {
                IngridientsInfo.Ingridient temp = IngridientsInfo.GetInfoAbout(item.ToString());
                result += temp.carbohydrates * 4 + temp.fats * 4 + temp.carbohydrates * 9;
            }

            return(result);
        }
Beispiel #2
0
        public double getCaloriesValue()
        {
            IngridientsInfo.Ingridient bread = IngridientsInfo.GetInfoAbout("Bread");
            double result = bread.carbohydrates * 4 + bread.fats * 4 + bread.carbohydrates * 9;

            result *= NumberBreads;

            IngridientsInfo.Ingridient cutlet = IngridientsInfo.GetInfoAbout("Сutlet");
            result += (cutlet.carbohydrates * 4 + cutlet.fats * 4 + cutlet.carbohydrates * 9) * NumberСutlet;

            foreach (AdditionalIngredients item in additionals)
            {
                IngridientsInfo.Ingridient temp = IngridientsInfo.GetInfoAbout(item.ToString());
                result += temp.carbohydrates * 4 + temp.fats * 4 + temp.carbohydrates * 9;
            }

            return(result);
        }