Exemplo n.º 1
0
    internal bool DeliverPlate(Plate plate)
    {
        bool success;

        Order matchedOrder;

        if (orderManager.AttemptDelivery(plate, out matchedOrder))
        {
            // success! add score based on (completed order + time left)
            Debug.Log($"Delivery complete with {matchedOrder.TimeLeft} seconds left!!!");
            AddPoints(100);
            success = true;
        }
        else
        {
            // plate didn't match any order!
            // penalize score
            Debug.Log("Delivery didn't match any order!!!");
            AddPoints(-100);
            success = false;
        }

        plate.EmptyAndResetPlate();
        return(success);
    }