/// <summary>
    /// Moves the selected bottle up, and the squirt bottle down
    /// </summary>
    /// <param name="index">The bottle to move</param>
    private IEnumerator MoveSauceUp_(int index)
    {
        _selectedSauce = (SauceType)index;

        var bottle = Chef.SauceBottles[index];

        // move bottle up
        while (bottle.localPosition.y < 8)
        {
            bottle.Translate(new Vector3(0, 14 * Time.deltaTime, 0));
            yield return(new WaitForSeconds(0.01f));
        }

        // change sauce appearance
        Chef.SquirtBottle.BottleImage.sprite = LicenseToGrillController.Instance.SauceImages[index];
        Chef.SquirtBottle.SauceImage.color   = ColourFetcher.GetSauceColour(index);

        // change particle colour
        var particleMain = Chef.SquirtBottle.SquirtParticle.main;

        particleMain.startColor = ColourFetcher.GetSauceColour(index);

        // move big bottle down
        while (Chef.SquirtBottle.transform.localPosition.y > SAUCE_SQUIRT_BOTTLE_Y_POSITION)
        {
            Chef.SquirtBottle.transform.Translate(new Vector3(0, -14 * Time.deltaTime, 0));
            yield return(new WaitForSeconds(0.01f));
        }

        _action = ChefAction.SquirtingSauce;
        Chef.SaucePlatform.gameObject.SetActive(true);
        Chef.Help_Sauce.SetActive(true);
    }
Esempio n. 2
0
        private IAdditive SauceFactory(SauceType sauce, int quantity)
        {
            switch (sauce)
            {
            case SauceType.Alfredo:
                return(new Alfredo(quantity));

            case SauceType.Chily:
                return(new Chily(quantity));

            case SauceType.GarlicSauce:
                return(new GarlicSauce(quantity));

            case SauceType.Ketchup:
                return(new Ketchup(quantity));

            case SauceType.Marinara:
                return(new Marinara(quantity));

            case SauceType.Pesto:
                return(new Pesto(quantity));

            case SauceType.Ranch:
                return(new Ranch(quantity));

            default:
                throw new NullReferenceException("No such sauce");
            }
        }
Esempio n. 3
0
        public void Cook(SauceType sauce, PastaType pastaType)
        {
            List <Ingredient> ingredients = new List <Ingredient>();

            if (sauce == SauceType.Alfredo)
            {
                ingredients.Add(GetIngredient(IngredientTypes.Cream, Places.Refrigarator));
            }
            else if (sauce == SauceType.Bolognese || sauce == SauceType.Marinara)
            {
                ingredients.Add(GetIngredient(IngredientTypes.Tomato, Places.Garden));
            }
            else if (pastaType == PastaType.Ravioly)
            {
                List <Ingredient> tempIngredients = ingredients.ToList();
                ingredients.Clear();
                ingredients.Add(GetPasta(PastaType.Ravioly, Places.Freezer));
                ingredients.AddRange(tempIngredients);
            }
            else if (sauce == SauceType.Pesto || sauce == SauceType.Marinara)
            {
                ingredients.Add(GetIngredient(IngredientTypes.Basil, Places.Garden));
            }
            else if (sauce == SauceType.Marinara)
            {
                ingredients.Add(GetIngredient(IngredientTypes.Onion, Places.Garden));
            }
            else if (pastaType == PastaType.FreshSpaghetti)
            {
                ingredients.Add(GetPasta(PastaType.FreshSpaghetti, Places.Freezer));
            }
            if (ingredients[0].IsPastaType)
            {
                List <Ingredient> fillingIngredients = ingredients.GetRange(1, ingredients.Count - 1).ToList();
                Prepare(ingredients[0]);
                Fill(fillingIngredients);
                CookPasta();
            }
            else
            {
                CookPasta();
                List <Ingredient> sauceIngredients = ingredients.GetRange(0, ingredients.Count - 1).ToList();
                Prepare(ingredients[ingredients.Count - 1]);
                Fill(sauceIngredients);
                AddSauce();
            }
        }
Esempio n. 4
0
 public Dish(SauceType sauce, PastaType pasta)
 {
     this.sauce = sauce;
     this.pasta = pasta;
 }
 public BuilderFunctional WithSauce(SauceType sauce)
 {
     Actions.Add(pizza => pizza.Sauce = sauce);
     return(this);
 }
 public T WithSauce(SauceType sauce)
 {
     pizza.Sauce = sauce;
     return((T)this);
 }
Esempio n. 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="sauceType">The type to set</param>
 public BurgerSauce(SauceType sauceType, float size)
 {
     _type = sauceType;
     _size = size;
 }