예제 #1
0
 public void AddClient(ClientItem item)
 {
     if (!Clients.Exists(v => v.id == item.id))
     {
         Clients.Add(item);
     }
 }
예제 #2
0
 public void AddClient(ClientItem item)
 {
     if (Clients.Count < 5)
     {
         Clients.Add(item);
     }
     UpdateClient(item);
 }
예제 #3
0
        private IEnumerator eatting(float time = 5)
        {
            Debug.Log(client.id + "号桌客人正在就餐");
            yield return(new WaitForSeconds(time));

            Debug.Log(client.id + "客人离开饭店");
            client      = null;
            text.text   = "该桌子暂无客人";
            image.color = Color.white;
        }
예제 #4
0
 public void UpdateClient(ClientItem item)
 {
     for (int i = 0; i < Clients.Count; i++)
     {
         if (Clients[i].id == item.id)
         {
             Clients[i] = item;
             return;
         }
     }
 }
예제 #5
0
 public void UpdateState(ClientItem client)
 {
     for (int i = 0; i < clients.Count; i++)
     {
         if (clients[i].client.id.Equals(client.id))
         {
             clients[i].InitClient(client);
             return;
         }
     }
 }
예제 #6
0
 public void DeleteClient(ClientItem item)
 {
     Debug.Log(item);
     for (int i = 0; i < Clients.Count; i++)
     {
         if (Clients[i].id == item.id)
         {
             Clients[i].state = 3;
             SendNotification(OrderSystemEvent.ADD_GUEST, Clients[i]);
             return;
         }
     }
     Debug.Log("客人走了刷新一下界面");
 }
예제 #7
0
 public void UpdateClient(ClientItem item)
 {
     Debug.Log(item.state);
     for (int i = 0; i < Clients.Count; i++)
     {
         if (Clients[i].id == item.id)
         {
             Clients[i]            = item;
             Clients[i].state      = item.state;
             Clients[i].population = item.population;
             SendNotification(OrderSystemEvent.ADD_GUEST, Clients[i]);
             return;
         }
     }
 }
예제 #8
0
        public override void HandleNotification(INotification notification)
        {
            Debug.Log(notification.Name);
            switch (notification.Name)
            {
            case OrderSystemEvent.CALL_WAITER:
                ClientItem client = notification.Body as ClientItem;
                Debug.Log(client.id + " 号桌顾客呼叫服务员 , 索要菜单 ");
                //  SendNotification(OrderSystemEvent.CALL_WAITER,client);
                break;

            case OrderSystemEvent.ORDER:
                Order order1 = notification.Body as Order;
                if (null == order1)
                {
                    throw new Exception("order1 is null ,please check it!");
                }
                order1.client.state++;
                View.UpdateState(order1.client);
                break;

            case OrderSystemEvent.PAY:
                // Order finishOrder = notification.Body as Order;
                WaiterItem item = notification.Body as WaiterItem;
                // if ( null == finishOrder )
                //   throw new Exception("finishOrder is null ,please check it!");
                View.UpdateState(item.order.client);
                ////--------------------------------
                ////自己填的
                //SendNotification(OrderSystemEvent.CALL_Room);
                ////-------------------------------------

                break;

            case OrderSystemEvent.ADD_GUEST:
                Debug.Log("刷新界面");
                //clientProxy = Facade.RetrieveProxy(ClientProxy.NAME) as ClientProxy;
                ClientItem clientItem = notification.Body as ClientItem;
                if (null == clientProxy)
                {
                    throw new Exception("获取" + ClientProxy.NAME + "代理失败");
                }
                View.UpdateState(clientItem);
                break;
            }
        }
예제 #9
0
        public override void HandleNotification(INotification notification)
        {
            switch (notification.Name)
            {
            case OrderSystemEvent.CALL_WAITER:
                ClientItem client = notification.Body as ClientItem;
                Debug.Log("aaa");
                SendNotification(OrderSystemEvent.GET_ORDER, client, "Get");    //请求获取菜单的命令 GetAndExitOrderCommed
                break;

            case OrderSystemEvent.ORDER:
                SendNotification(OrderSystemEvent.CALL_COOK, notification.Body);
                break;

            case OrderSystemEvent.GET_PAY:
                Debug.Log(" 服务员拿到顾客的付款 ");
                ClientItem item = notification.Body as ClientItem;
                // SendNotification(OrderSystemEvent.selectWaiter, item, "WANSHI"); //付完款之和将服务员状态变更
                //SendNotification(OrderSystemEvent.GUEST_BE_AWAY, item, "Remove");

                SendNotification(OrderSystemEvent.GET_ORDER, item, "GetHouse");
                SendNotification(OrderSystemEvent.GUEST_BE_AWAY, item, "Remove");

                break;

            case OrderSystemEvent.FOOD_TO_CLIENT:
                Debug.Log(" 服务员上菜 ");
                // Debug.Log(notification.Body.GetType());
                WaiterItem waiterItem = notification.Body as WaiterItem;
                waiterItem.order.client.state++;
                SendNotification(OrderSystemEvent.PAY, waiterItem);
                break;

            case OrderSystemEvent.ResfrshWarite:
                waiterProxy = Facade.RetrieveProxy(WaiterProxy.NAME) as WaiterProxy;
                WaiterView.Move(waiterProxy.Waiters);    //刷新一下服务员的状态
                break;

            case OrderSystemEvent.EndPay:
                Order order = notification.Body as Order;

                break;
            }
        }
예제 #10
0
 public void DeleteClient(ClientItem item)
 {
     Clients.Remove(item);
 }
예제 #11
0
 public void AddClient(ClientItem item)
 {
     UpdateClient(item);
     Clients.Add(item);
 }
예제 #12
0
 public void InitClient(ClientItem client)
 {
     this.client = client;
     UpdateState();
 }
예제 #13
0
 public Order(ClientItem client, IList <MenuItem> menus)
 {
     this.client = client;
     this.menus  = menus;
 }
예제 #14
0
 public void Move(WaiterItem waiter, ClientItem client)
 {
 }