コード例 #1
0
        public override void FreePlace()
        {
            _possibleOrders.Clear();
            _possibleOrders.AddRange(OrdersController.Instance.Orders);

            CurOrder.Clear();

            foreach (var place in Places)
            {
                place.FreePlace();
            }

            CurOrderUpdated?.Invoke();
        }
コード例 #2
0
        public override bool TryPlaceFood(Food food)
        {
            if (!CanAddFood(food))
            {
                return(false);
            }

            foreach (var place in Places)
            {
                if (!place.TryPlaceFood(food))
                {
                    continue;
                }

                CurOrder.Add(food.Name);
                UpdatePossibleOrders();
                CurOrderUpdated?.Invoke();
                return(true);
            }
            return(false);
        }