Ejemplo n.º 1
0
        /// <summary>
        ///     重连
        /// </summary>
        /// <param name="data"></param>
        /// <param name="lastIn"></param>
        /// <param name="isCurrent"></param>
        public virtual void OnReJoin(ISFSObject data)
        {
            #region Data

            ISFSArray Groups;
            int[]     OutCards;
            int[]     HandCards;
            int       HandNum;
            bool      hasTing;
            GameTools.TryGetValueWitheKey(data, out Groups, RequestKey.KeyGroups);
            GameTools.TryGetValueWitheKey(data, out OutCards, RequestKey.KeyOutCards);
            GameTools.TryGetValueWitheKey(data, out HandCards, RequestKey.KeyHandCards);
            GameTools.TryGetValueWitheKey(data, out HandNum, RequestKey.KeyHandCardsNum);
            GameTools.TryGetValueWitheKey(data, out hasTing, RequestKey.KeyHasTing);
            HasTing       = hasTing;
            GroupItems    = new List <MahjongGroupData>();
            ThrowOutCards = new List <int>();
            GroupItems.AddRange(GameTools.GetGroupData(Groups));
            ThrowOutCards.AddRange(OutCards.ToList());
            if (HandCards.Length.Equals(0))
            {
                HandCards = new int[HandNum];
            }
            HandCardList = HandCards.ToList();

            #endregion

            #region UI

            MahjongEnv.AddOutCards(ThrowOutCards);
            for (int i = 0, lenth = GroupItems.Count; i < lenth; i++)
            {
                MahjongEnv.AddGroup(GroupItems[i], null, IsOther);
            }
            AddHandCards(HandCardList);
            if (hasTing)
            {
                ShowTingWithEffect(false);
            }

            #endregion
        }