Beispiel #1
0
 bool IsOrderValid(Salad s)
 {
     for (int i = 0; i < saladCombo.Count; i++)
     {
         if (s.ContainsVegetable(saladCombo[i]))
         {
             continue;
         }
         return(false);
     }
     return(true);
 }
Beispiel #2
0
    IEnumerator ChopProcess(Vegetable v)
    {
        boardAssignedTo.PauseMovement();
        //Wait for a while to finish chopping
        yield return(new WaitForSeconds(1));

        v.ChopVegetable();

        //If vegetable slot if empty, then assign it to the vegetable slot of the cutting board
        if (veggie == null)
        {
            if (salad == null)
            {
                MakeSalad(v);
            }
            else
            {
                if (!salad.ContainsVegetable(v))
                {
                    AddToSalad(v);
                }
                else
                {
                    veggie = v;
                }
            }
        }
        else
        {
            Debug.Log("Veggie and salad are not null....Give salad to the customer or take it out");
        }

        boardAssignedTo.ResumeMovement();

        cuttingInProcess = false;
    }