예제 #1
0
        public void AddFermentable()
        {
            fermentableAddition fa = RecipeTools.makeEmptyFermentablAddition();//new fermentableAddition();

            fermentableState.currentSelectedFermentableID = "";

            if (Model.fermentables.Count > 0)
            {
                Model.fermentables.Insert(fermentableState.currentSelectedFermentableIndex + 1, fa);
                fermentableState.currentSelectedFermentableIndex++;
            }
            else
            {
                Model.fermentables.Add(fa);
                fermentableState.currentSelectedFermentableIndex = 0;
            }
            Save(false);
        }
예제 #2
0
        public void AddYeast()
        {
            yeastAddition ya = RecipeTools.makeEmptyYeastAddition();

            yeastState.currentSelectedYeastID = "";

            if (Model.yeasts.Count > 0)
            {
                Model.yeasts.Insert(yeastState.currentSelectedYeastIndex + 1, ya);
                yeastState.currentSelectedYeastIndex++;
            }
            else
            {
                Model.yeasts.Add(ya);
                yeastState.currentSelectedYeastIndex = 0;
            }
            Save(false);
        }
예제 #3
0
        public void AddAdjunct()
        {
            adjunctAddition aa = RecipeTools.makeEmptyAdjunctAddition();//new adjunctAddition();
            //adjunct adjunct = new adjunct();
            //aa.adjunct = adjunct;
            adjunctState.currentSelectedAdjunctID = "";

            if (Model.adjuncts.Count > 0)
            {
                Model.adjuncts.Insert(adjunctState.currentSelectedAdjunctIndex + 1, aa);
                adjunctState.currentSelectedAdjunctIndex++;
            }
            else
            {
                Model.adjuncts.Add(aa);
                adjunctState.currentSelectedAdjunctIndex = 0;
            }
            Save(false);
        }
예제 #4
0
        public async void AddHop()
        {
            hopAddition ha = RecipeTools.makeEmptyHopAddition();

            hopState.currentSelectedHopID = "";
            hopUse = "";

            if (Model.hops.Count > 0)
            {
                Model.hops.Insert(hopState.currentSelectedHopIndex + 1, ha);
                hopState.currentSelectedHopIndex++;
            }
            else
            {
                Model.hops.Add(ha);
                hopState.currentSelectedHopIndex = 0;
                //hopState.currentSelectedHopIndex++;
            }
            Save(false);
        }
예제 #5
0
        public static recipe initializeBlankRecipe()
        {
            recipe newRecipe = new recipe();

            currentRecipeId = "-1";

            newRecipe.name        = "";
            newRecipe.description = "";

            newRecipe.style = new style();

            newRecipe.recipeStats = new RecipeStatistics
            {
                abv = 0,
                fg  = 0,
                og  = 0,
                srm = 0,
                ibu = 0
            };

            RecipeParameters rp = new RecipeParameters
            {
                fermentableCalcType = "basic",
                ibuBoilTimeCurveFit = -0.04F,
                ibuCalcType         = "basic",
                intoFermenterVolume = 0
            };

            newRecipe.recipeParameters = rp;

            newRecipe.equipmentProfile = RecipeTools.getDefaultEquipmentProfile();

            newRecipe.adjuncts     = new List <adjunctAddition>();
            newRecipe.fermentables = new List <fermentableAddition>();
            newRecipe.hops         = new List <hopAddition>();
            newRecipe.yeasts       = new List <yeastAddition>();
            //hopAddition a = new hopAddition();
            //a.hopID = "";
            //a.type = "";
            //a.additionGuid = "";
            //a.amount = 0;
            //a.time = 0;
            //hopbase b = new hopbase();
            //b.aau = 1;
            //b.type = "idk";
            //b.substitutes = "";
            //b.createdByUserId = "";
            //b.idString = "";
            //b.name = "Centennial";
            //b.notes = "";
            //b.origin = "";
            //a.hop = b;
            //newRecipe.hops.Add(a);


            //    fermentable f = new fermentable
            //    {
            //        color = 6,
            //        name = "2 Row",
            //        yield = 14.65F,
            //        maltster = "Breiss"
            //    };

            //    fermentableAddition fa = new fermentableAddition
            //    {
            //        use = "Mash",
            //        weight = 12.5F,
            //        fermentable = f
            //    };

            //    yeast y = new yeast
            //    {
            //        attenuation = 1.05F,
            //        lab = "Wyeast",
            //        name = "Wheat"
            //    };

            //    yeastAddition ya = new yeastAddition
            //    {
            //        yeast = y
            //};

            //    adjunct ad = new adjunct
            //    {
            //        name = "Cocoa nibs"
            //    };

            //    adjunctAddition aa = new adjunctAddition
            //    {
            //        adjunct = ad,
            //        amount = 2,
            //        time = 60,
            //        timeUnit = "min",
            //        type = "boil",
            //        unit = "oz"
            //    };

            //    newRecipe.fermentables.Add(fa);
            //    newRecipe.yeasts.Add(ya);
            //    newRecipe.adjuncts.Add(aa);

            return(newRecipe);
        }