Inheritance: MonoBehaviour
示例#1
0
        bool VisualizeInteraction(Service origin, string branchName, Service target, IInteraction parentParameters)
        {
            MetaInteraction aboutInteraction = new MetaInteraction(parentParameters,
                                                                   origin, branchName, target);

            return(InteractionView.TryProcess(aboutInteraction));
        }
示例#2
0
    /// <summary>
    /// 抢地主
    /// </summary>
    private void OnGrabClick()
    {
        InteractionView.DeactiveAll();
        GrabAndDisGrabArgs e = new GrabAndDisGrabArgs()
        {
            cType = CharacterType.Player
        };

        dispatcher.Dispatch(CommandEvent.GrabLanlord, e);
    }
示例#3
0
    /// <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);
    }
示例#4
0
 /// <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();
         }
     }
 }
示例#5
0
 /// <summary>
 /// 玩家出牌显示UI
 /// </summary>
 /// <param name="canClick"></param>
 void RoundModel_PlayerHandle(bool canClick)
 {
     InteractionView.ActiveDealOrPass(canClick);
 }
示例#6
0
 /// <summary>
 /// 发牌结束
 /// </summary>
 /// <param name="payload"></param>
 private void OnCompleteDeal(IEvent payload)
 {
     InteractionView.ActiveGrabOrDisGrab();
 }
示例#7
0
 /// <summary>
 /// 点击发牌事件
 /// </summary>
 private void OnDealClick()
 {
     dispatcher.Dispatch(CommandEvent.RequestDeal);
     InteractionView.DeactiveAll();
 }
示例#8
0
 /// <summary>
 /// 不出
 /// </summary>
 private void OnPassClick()
 {
     InteractionView.DeactiveAll();
     dispatcher.Dispatch(CommandEvent.PassCard);
 }
示例#9
0
 /// <summary>
 /// 成功出牌
 /// </summary>
 /// <param name="payload"></param>
 private void OnSuccessedPlay()
 {
     InteractionView.DeactiveAll();
 }