Exemplo n.º 1
0
    public PouringPath generatePouringPath()
    {
        //Generate here
        List <PouringDrink> pdList = new List <PouringDrink>();

        foreach (OBSGlass g in plate.glasses)
        {
            PouringDrink pd = new PouringDrink();
            pd.glassPosition = g.pos;
            DrinkMix mix = mixes[g.plug];

            //Debug.Log("Glass at pos " + g.pos + " will get mix " + mix.mixName);
            foreach (QuantifiedIngredient qi in mix.ingredients)
            {
                //Debug.Log(" > Ingredient " + qi.ingredientName);
                pd.ingredientStates.Add(qi.Clone(), false);
            }

            pdList.Add(pd);
        }

        PouringPath p = getPathForDrinks(pdList);

        return(p);
    }
Exemplo n.º 2
0
    public PouringDrink Clone()
    {
        PouringDrink pd = new PouringDrink();

        pd.glassPosition = glassPosition;

        foreach (KeyValuePair <QuantifiedIngredient, bool> iState in ingredientStates)
        {
            pd.ingredientStates.Add(iState.Key, iState.Value);
        }
        return(pd);
    }
Exemplo n.º 3
0
    private List <QuantifiedIngredient> getMixIngredientWithPositionForDrink(int absolutePosition, PouringDrink d, List <MixIngredient> iList)
    {
        List <QuantifiedIngredient> result = new List <QuantifiedIngredient>();

        foreach (MixIngredient mi in ingredients)
        {
            if (mi.platePosition == absolutePosition)
            {
                foreach (KeyValuePair <QuantifiedIngredient, bool> qi in d.ingredientStates)
                {
                    if (qi.Key.ingredientName == mi.ingredientName)
                    {
                        result.Add(qi.Key);
                        break;
                    }
                }
            }
        }

        return(result);
    }
Exemplo n.º 4
0
 private List <QuantifiedIngredient> getMixIngredientWithPositionForDrink(int absolutePosition, PouringDrink d)
 {
     return(getMixIngredientWithPositionForDrink(absolutePosition, d, ingredients));
 }