Exemplo n.º 1
0
    //removes the order slip from the the currentlyDisplayedOrders list and hides its gameobj
    //then, it checks for hidden orders to display
    public void RemoveOrderSlip(VR_OrderSlipBehaviour orderSlip)
    {
        Debug.Log("remove order slip called");

        //disable the orderSlip
        orderSlip.gameObject.SetActive(false);

        //remove the order from the order slip list
        currentlyDisplayedOrders.Remove(orderSlip.OrderSlipOrder);
        orderSlip.ResetOrderSlip();

        //display a hidden order (if any)
        CheckAndDisplayHiddenOrders();
    }
    //-----------------------------------------------------------------SERVING AN ORDER-----------------------------------------------------------------------
    //method to serve the dish that the order slip is being placed on

    /*
     * public void CheckCanServeDish(VR_OrderSlipBehaviour _orderSlip)
     * {
     *  ChickenRice orderDetails = _orderSlip.OrderSlipOrder;
     *
     *  //get the index num of the empty space on the counter
     *  int indexNum = SpawnDishOnCounter.Instance.CheckCounterHasSpace(); //returns -1 if there is no space
     *
     *  // if there is space on the counter, remove the order slip and spawn the dish
     *  if (indexNum > -1)
     *  {
     *      SpawnDishOnCounter.Instance.SpawnDish(indexNum, orderDetails.RoastedChic, orderDetails.RicePlain, orderDetails.HaveEgg);
     *
     *      RemoveOrderSlip(_orderSlip);
     *  }
     *  else //if the serve counter is full, give feedback
     *  {
     *      Debug.Log("Service counter is too full to spawn dish");
     *  }
     *
     * }*/


    //removes the order slip from the the currentlyDisplayedOrders list and hides its gameobj
    //then, it checks for hidden orders to display
    public void RemoveOrderSlip(VR_OrderSlipBehaviour orderSlip)
    {
        Debug.Log("remove order slip called");

        //remove the order from the order slip list
        currentlyDisplayedOrders.Remove(orderSlip.OrderSlipOrder);

        orderSlip.StopChangingBackgroundColor();
        orderSlip.ToggleColliderAndVisuals(false);
        orderSlip.ResetOrderSlip();

        //display a hidden order (if any)
        CheckAndDisplayHiddenOrders();
    }