示例#1
0
 public Cafe(IMealtime mealtime)
 {
     main    = mealtime.GetMain();
     salad   = mealtime.GetSalad();
     dessert = mealtime.GetDessert();
     drink   = mealtime.GetDrink();
 }
        private void OnDisable()
        {
            serviceQuality = (waitTimer / waitingTime) * 100;

            currentOrder = null;
            Notify();
        }
示例#3
0
        public override void Construct()
        {
            saladItems = new List <ISaladItem>();
            saladItems.Add(new Vegetable("Cabbage", 10, 300, 150, 270));
            saladItems.Add(new Oil("Vegetable oil", 5, 15, 100));
            saladItems.Add(new Salt("Salt", 7, 2, new List <string>()
            {
                "sodium chloride"
            }));

            cabbageSalad = new Salad("Cabbage Salad", saladItems);
        }
        private void OrderUp()
        {
            ISalad orderSalad = saladFactory.GetSalad();

            for (int i = 0; i < Random.Range(MIN_VEGGIE_IN_SALAD, MAX_VEGGIE_IN_SALAD + 1); i++)
            {
                orderSalad.currentMix.Add(GetRandomChopedVeggie());
            }
            currentOrder = orderSalad;
            DecideWaitingTime();
            customerHUD.UpdateOrderUI(orderSalad);
        }
示例#5
0
 /// <summary>
 ///Compares two salads,they are same if same number type and state of each vegetable in salad are same.
 /// </summary>
 /// <param name="salad">Salad that has to be compared with this.</param>
 /// <returns>If salad are same returns true else false.</returns>
 public bool IsSame(ISalad salad)
 {
     if (currentMix.Count != salad.currentMix.Count)
     {
         return(false);
     }
     for (int i = 0; i < salad.currentMix.Count; i++)
     {
         if (salad.currentMix.Contains(currentMix[i]))
         {
             return(false);
         }
     }
     return(true);
 }
 public void UpdateOrderUI(ISalad salad)
 {
     if (salad == null)
     {
         Debug.LogError("Salad to order is empty!");
         return;
     }
     ClearPreviouOrderIcons();
     for (int i = 0; i < salad.currentMix.Count; i++)
     {
         var veggieInOrder = Instantiate(requestingVeggiePrefab, requestingVeggiePrefab.transform.parent);
         veggieInOrder.GetComponent <Image>().sprite = salad.currentMix[i].stateSpriteDictionary[ProcessingState.RAW];
         orderingItems.Enqueue(veggieInOrder);
         veggieInOrder.SetActive(true);
     }
 }
        /// <summary>
        /// Serves the order to customer , if right order is server customer accepts and leaves.
        /// else customer rejects the order.
        /// </summary>
        /// <param name="salad">Oder being served to this customer.</param>
        /// <returns>If Salad being served is same as the one that is ordered.</returns>
        public bool Service(ISalad salad, string chefID)         //Can change this into abstract order to extend scope for other dishes.
        {
            _servicedBy.Add(chefID);

            if (currentOrder.IsSame(salad))
            {
                customerHUD.HideProgress();
                TickableManager.Instance.Unsubscribe(this);
                gameObject.SetActive(false);
                Debug.Log("Hurray!CHOM CHOM CHOM CHOM....");
                return(true);
            }
            else
            {
                _isAngry = true;
                Debug.Log("Wrong Order!Customer got angry at :" + chefID);
                return(false);
            }
        }
示例#8
0
 public void ChooseSalad(ISalad salad)
 {
     _saladDecorator.ChooseSalad(salad);
 }
示例#9
0
 public void ChooseSalad(ISalad salad)
 {
     _ingredient = salad;
 }