bool VisualizeInteraction(Service origin, string branchName, Service target, IInteraction parentParameters) { MetaInteraction aboutInteraction = new MetaInteraction(parentParameters, origin, branchName, target); return(InteractionView.TryProcess(aboutInteraction)); }
/// <summary> /// 抢地主 /// </summary> private void OnGrabClick() { InteractionView.DeactiveAll(); GrabAndDisGrabArgs e = new GrabAndDisGrabArgs() { cType = CharacterType.Player }; dispatcher.Dispatch(CommandEvent.GrabLanlord, e); }
/// <summary> /// 不抢地主 /// </summary> private void OnDisGrabClick() { InteractionView.DeactiveAll(); CharacterType temp = (CharacterType)Random.Range(2, 4); GrabAndDisGrabArgs e = new GrabAndDisGrabArgs() { cType = temp }; dispatcher.Dispatch(CommandEvent.GrabLanlord, e); }
/// <summary> /// This show an interaction view, aka popup windows action with a confirmation. /// The user shall confirm the action performed in the popup. We retrieve the view and /// the view model to be shown directly from the container. /// </summary> /// <typeparam name="ViewModelType">View model type to be shown.</typeparam> /// <typeparam name="ViewType">View type to be shown.</typeparam> public void ShowView <ViewModelType, ViewType>(ViewModelType viewModel) where ViewModelType : ICommandInteraction { if (_unityContainter != null) { var modalView = _unityContainter.Resolve <ViewType>(); var viewModelView = viewModel; if ((modalView != null) && (viewModelView != null)) { var view = modalView as UserControl; if (view != null) { view.DataContext = viewModelView; } InteractionView mainWindow = _unityContainter.Resolve <InteractionView>(); var detailsRegionManager = mainWindow.CurrentRegionManager; // var popupRegion = detailsRegionManager.Regions[RegionNames.PopUpContent]; // popupRegion.Add(modalView); mainWindow.Focus(); } } }
/// <summary> /// 玩家出牌显示UI /// </summary> /// <param name="canClick"></param> void RoundModel_PlayerHandle(bool canClick) { InteractionView.ActiveDealOrPass(canClick); }
/// <summary> /// 发牌结束 /// </summary> /// <param name="payload"></param> private void OnCompleteDeal(IEvent payload) { InteractionView.ActiveGrabOrDisGrab(); }
/// <summary> /// 点击发牌事件 /// </summary> private void OnDealClick() { dispatcher.Dispatch(CommandEvent.RequestDeal); InteractionView.DeactiveAll(); }
/// <summary> /// 不出 /// </summary> private void OnPassClick() { InteractionView.DeactiveAll(); dispatcher.Dispatch(CommandEvent.PassCard); }
/// <summary> /// 成功出牌 /// </summary> /// <param name="payload"></param> private void OnSuccessedPlay() { InteractionView.DeactiveAll(); }