Пример #1
0
 public void OperateReconnectGameData(ReConnectDataResp mReConnectDataResp)
 {
     if (mReConnectDataResp != null)
     {
         if (!mReConnectDataResp.Actions.IsNullOrEmpty())
         {
             mReConnectDataResp.Actions.ForEach(p => mUIGameModel.HandleGameAction(p));
         }
         if (!mReConnectDataResp.Players.IsNullOrEmpty())
         {
             mReConnectDataResp.Players.ForEach(p =>
             {
                 if (mUIGameModel.GetUser(p.UID) != null)
                 {
                     UserCardModel user = mUIGameModel.getOrAddUserCardModel(getPlayerIndex(p.Order));
                     if (user != null)
                     {
                         user.setHandCards(p.HandCards);
                         user.setDeskCards(p.DeskCards);
                         if (p.CurCard != null)
                         {
                             user.setTouchCard(p.CurCard);
                         }
                         user.setHandCardGroups(p.HandCardGroups);
                     }
                 }
             });
         }
         mUIGameModel.RefreshCardInfo();
         mUIGameModel.ReconnectGameAction(mReConnectDataResp.LastAction);
     }
 }
Пример #2
0
    private void OperateTouchCard(MahJongGameAction action)
    {
        mUserCardModel.setTouchCard(action.Cards[0]);
        mUserCardModel.addHandCard(action.Cards[0]);
        mCurrCardItem.Refresh(mUserCardModel.getTouchCard(), mDirection);

        //播放摸牌音效
        MahjongAudioMgr.Instance.PlayMoPai();
    }