public override void Execute(INotification notification) { base.Execute(notification); RoomProxy roomProxy = Facade.RetrieveProxy(nameof(RoomProxy)) as RoomProxy; roomProxy.RequestExitRoom(); }
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); }
public override void Execute(INotification notification) { RoomProxy roomProxy = Facade.RetrieveProxy(RoomProxy.NAME) as RoomProxy; // Order order = notification.Body as Order; roomProxy.Rooming(); }
public RoomViewModel() { Model = new RoomModel(); Room = new RoomProxy(Model.GetRoom()); OnModeChanged(Model.GetMode()); }
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); }
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); }
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); }
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); }
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)); }
public void Init() { Player = new PlayerProxy(); Player.Init(); Login = new LoginProxy(); Login.Init(); Room = new RoomProxy(); Room.Init(); Battle = new BattleProxy(); Battle.Init(); }