public void TryTrashFood()
        {
            if (_place.CurFood == null)
            {
                return;
            }
            if (_place.CurFood.CurStatus == Food.FoodStatus.Overcooked)
            {
                _startTimerBetweenClick = true;

                if (_doubleClick)
                {
                    _doubleClick = false;
                    _place.FreePlace();
                }
            }
        }
        public bool TryServeFood()
        {
            if (_place.IsFree || (_place.CurFood.CurStatus != Food.FoodStatus.Cooked))
            {
                return(false);
            }
            var order = OrdersController.Instance.FindOrder(new List <string>(1)
            {
                _place.CurFood.Name
            });

            if ((order == null) || !GameplayController.Instance.TryServeOrder(order))
            {
                return(false);
            }

            _place.FreePlace();
            return(true);
        }
Exemple #3
0
        public void TryTransferFood()
        {
            var food = _place.CurFood;

            if (food == null)
            {
                return;
            }

            if (OnlyTransferCooked && (food.CurStatus != Food.FoodStatus.Cooked))
            {
                _place.TryPlaceFood(food);
                return;
            }
            foreach (var place in DestPlaces)
            {
                if (!place.TryPlaceFood(food))
                {
                    continue;
                }
                _place.FreePlace();
                return;
            }
        }