Example #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);
     }
 }
Example #2
0
 private void OperateStartTouchCard(MahJongGameAction action)
 {
     if (mUserCardModel != null)
     {
         mUserCardModel.setHandCards(action.Cards);
         RefreshHandCards();
     }
 }