Beispiel #1
0
        public mg_pt_Order(mg_pt_GameLogic p_gameLogic)
        {
            m_gameLogic      = p_gameLogic;
            m_pizzaBaseCount = m_gameLogic.Minigame.Resources.PizzaBaseCount;
            m_sauces         = new List <mg_pt_OrderComponent>();
            m_sauces.Add(new mg_pt_OrderComponent(mg_pt_EToppingType.SAUCE_01));
            m_sauces.Add(new mg_pt_OrderComponent(mg_pt_EToppingType.SAUCE_02));
            m_cheese      = new mg_pt_OrderComponent(mg_pt_EToppingType.CHEESE);
            m_ingredients = new List <mg_pt_OrderComponent>();
            m_ingredients.Add(new mg_pt_OrderComponent(mg_pt_EToppingType.MIN_TOPPINGS));
            m_ingredients.Add(new mg_pt_OrderComponent(mg_pt_EToppingType.TOPPING_02));
            m_ingredients.Add(new mg_pt_OrderComponent(mg_pt_EToppingType.TOPPING_03));
            m_ingredients.Add(new mg_pt_OrderComponent(mg_pt_EToppingType.TOPPING_04));
            m_allToppings = new List <mg_pt_OrderComponent>();
            List <mg_pt_OrderComponent>   sauces = m_sauces;
            Action <mg_pt_OrderComponent> action = delegate(mg_pt_OrderComponent sauce)
            {
                m_allToppings.Add(sauce);
            };

            sauces.ForEach(action);
            m_allToppings.Add(m_cheese);
            m_ingredients.ForEach(delegate(mg_pt_OrderComponent ingredient)
            {
                m_allToppings.Add(ingredient);
            });
        }
Beispiel #2
0
        public void AddTopping(mg_pt_Topping p_topping)
        {
            mg_pt_OrderComponent mg_pt_OrderComponent2 = m_allToppings.Find((mg_pt_OrderComponent topping) => topping.Topping == p_topping.Type);

            if (mg_pt_OrderComponent2 != null)
            {
                if (p_topping.IsSauce)
                {
                    mg_pt_OrderComponent2.CurrentCount = 1;
                    int coins = 0;
                    m_sauces.ForEach(delegate(mg_pt_OrderComponent sauce)
                    {
                        coins += sauce.CoinsEarnt;
                    });
                    if (coins == 0)
                    {
                        mg_pt_OrderComponent2.CoinsEarnt++;
                        CoinsToAward++;
                    }
                }
                else if (p_topping.IsCheese)
                {
                    mg_pt_OrderComponent2.CurrentCount = 1;
                    if (mg_pt_OrderComponent2.CoinsEarnt == 0)
                    {
                        mg_pt_OrderComponent2.CoinsEarnt++;
                        CoinsToAward++;
                    }
                }
                else
                {
                    mg_pt_OrderComponent2.CurrentCount++;
                    CoinsToAward++;
                }
                if (p_topping.IsSauce)
                {
                    if (mg_pt_OrderComponent2.RequiredCount > 0 || MysteryPizza)
                    {
                        m_gameLogic.Minigame.PlaySFX("mg_pt_sfx_topping_drop");
                    }
                }
                else
                {
                    m_gameLogic.Minigame.PlaySFX((mg_pt_OrderComponent2.RequiredCount > 0 || MysteryPizza) ? "mg_pt_sfx_topping_drop" : "mg_pt_sfx_topping_error");
                }
            }
            m_gameLogic.OnOrderChanged();
            CheckCompletion();
        }