コード例 #1
0
        public override void Execute(INotification notification)
        {
            base.Execute(notification);
            RoomProxy roomProxy = Facade.RetrieveProxy(nameof(RoomProxy)) as RoomProxy;

            roomProxy.RequestExitRoom();
        }
コード例 #2
0
ファイル: RoomMediator.cs プロジェクト: Asyky-star/FurMvc
    public override void HandleNotification(INotification notification)//处理通知
    {
        switch (notification.Name)
        {
        case OrderSystemEvent.CALL_Room:
            //选择一个房间入住
            //--------------------------------
            //自己填的
            SendNotification(OrderSystemEvent.Rooming);
            //--------
            break;

        case OrderSystemEvent.ReshRooms:
            //刷新房间状态
            roomProxy = Facade.RetrieveProxy(RoomProxy.NAME) as RoomProxy;
            Debug.Log("刷新房间的状态");
            if (null == roomProxy)
            {
                throw new Exception(RoomProxy.NAME + "is null");
            }
            RoomView.ResfrshRoom(roomProxy.Rooms);
            break;

        case OrderSystemEvent.Pay_rooms:
            roomProxy = Facade.RetrieveProxy(RoomProxy.NAME) as RoomProxy;
            Debug.Log("刷新房屋状态");
            if (null == roomProxy)
            {
                throw new Exception(RoomProxy.NAME + "is null.");
            }
            RoomView.ResfrshRoom(roomProxy.Rooms);
            break;
        }
        base.HandleNotification(notification);
    }
コード例 #3
0
    public override void Execute(INotification notification)
    {
        RoomProxy roomProxy = Facade.RetrieveProxy(RoomProxy.NAME) as RoomProxy;

        //   Order order = notification.Body as Order;
        roomProxy.Rooming();
    }
コード例 #4
0
        public RoomViewModel()
        {
            Model = new RoomModel();
            Room  = new RoomProxy(Model.GetRoom());

            OnModeChanged(Model.GetMode());
        }
コード例 #5
0
        public override void Execute(INotification notification)
        {
            base.Execute(notification);
            RoomProxy roomProxy    = Facade.RetrieveProxy(nameof(RoomProxy)) as RoomProxy;
            var       prepareState = (bool)notification.Body;

            roomProxy.RequestChangePrepareState(prepareState);
        }
コード例 #6
0
        public override void Execute(INotification notification)
        {
            base.Execute(notification);
            RoomProxy roomProxy = Facade.RetrieveProxy(nameof(RoomProxy)) as RoomProxy;
            var       message   = notification.Body as string;

            roomProxy.RequestSendMessage(message);
        }
コード例 #7
0
        public override void Execute(INotification notification)
        {
            base.Execute(notification);
            RoomProxy roomProxy = Facade.RetrieveProxy(nameof(RoomProxy)) as RoomProxy;
            var       playerId  = notification.Body as string;

            roomProxy.RequestKickPlayer(playerId);
        }
コード例 #8
0
ファイル: RoomMediator.cs プロジェクト: Asyky-star/FurMvc
 public override void OnRegister() //注册
 {
     base.OnRegister();
     roomProxy = Facade.RetrieveProxy(RoomProxy.NAME) as RoomProxy;
     if (null == roomProxy)
     {
         throw new Exception(RoomProxy.NAME + "is null");
     }
     RoomView.UpdateRoom(roomProxy.Rooms);
 }
コード例 #9
0
ファイル: StartUpCommand.cs プロジェクト: Asyky-star/FurMvc
        public override void Execute(INotification notification)
        {
            //菜单代理
            MenuProxy menuProxy = new MenuProxy();

            Facade.RegisterProxy(menuProxy);

            //客户端代理
            ClientProxy clientProxy = new ClientProxy();

            Facade.RegisterProxy(clientProxy);

            //服务员代理
            WaiterProxy waitProxy = new WaiterProxy();

            Facade.RegisterProxy(waitProxy);

            //厨师代理
            CookProxy cookProxy = new CookProxy();

            Facade.RegisterProxy(cookProxy);

            //-----------------------------------------
            //自己填的客房代理
            RoomProxy roomProxy = new RoomProxy();

            Facade.RegisterProxy(roomProxy);
            //---------------------------------------

            OrderProxy orderProxy = new OrderProxy();

            Facade.RegisterProxy(orderProxy);

            MainUI mainUI = notification.Body as MainUI;

            if (null == mainUI)
            {
                throw new Exception("程序启动失败..");
            }
            Facade.RegisterMediator(new MenuMediator(mainUI.MenuView));
            Facade.RegisterMediator(new ClientMediator(mainUI.ClientView));
            Facade.RegisterMediator(new WaiterMediator(mainUI.WaitView));
            Facade.RegisterMediator(new CookMediator(mainUI.CookView));
            //----------------------------
            //自己填的客房命令
            Facade.RegisterMediator(new RoomMediator(mainUI.roomView));

            //--------------------------------------
            Facade.RegisterCommand(OrderSystemEvent.GUEST_BE_AWAY, typeof(GuestBeAwayCommed));
            Facade.RegisterCommand(OrderSystemEvent.GET_ORDER, typeof(GetAndExitOrderCommed));
            Facade.RegisterCommand(OrderSystemEvent.CookCooking, typeof(CookCommend));
            Facade.RegisterCommand(OrderSystemEvent.selectWaiter, typeof(WaiterCommend));
            Facade.RegisterCommand(OrderSystemEvent.Rooming, typeof(RoomCommand));
        }
コード例 #10
0
    public void Init()
    {
        Player = new PlayerProxy();
        Player.Init();

        Login = new LoginProxy();
        Login.Init();

        Room = new RoomProxy();
        Room.Init();

        Battle = new BattleProxy();
        Battle.Init();
    }