示例#1
0
        public void SetResultInfo(ISFSObject data, MahjongPlayer player, List <int> handCards, List <int> huList)
        {
            #region data

            int       type;
            long      totalGold;
            ISFSArray Groups;
            GameTools.TryGetValueWitheKey(data, out type, RequestKey.KeyType);
            GameTools.TryGetValueWitheKey(data, out _huNum, RequestKey.KeyHuNum);
            GameTools.TryGetValueWitheKey(data, out _gangNum, RequestKey.KeyGangNum);
            GameTools.TryGetValueWitheKey(data, out _fanName, RequestKey.KeyHuName);
            GameTools.TryGetValueWitheKey(data, out _totalNum, RequestKey.KeyGold);
            GameTools.TryGetValueWitheKey(data, out totalGold, RequestKey.KeyTotalGold);
            GameTools.TryGetValueWitheKey(data, out Groups, RequestKey.KeyGroups);
            var groups = GameTools.GetGroupData(Groups);
            YxDebug.Log("手牌总长度是:" + handCards.Count);
            _isWiner = type > 0;
            if (type == 2) //目前自摸情况下,会把胡的那张牌从手牌中带回来,这里删掉。目前只有一个胡牌,所以这么删,待扩展
            {
                handCards.Remove(huList[0]);
            }
            YxDebug.Log("手牌实际长度是:" + handCards.Count);

            #endregion

            #region UI

            LabelUserName.text = player.UserInfo.name;
            ZhuangSprite.SetActive(player.IsZhuang);
            LabelFanName.text = _fanName;
            YxTools.TrySetComponentValue(LabelHuScore, YxUtiles.GetShowNumber(_huNum).ToString());
            YxTools.TrySetComponentValue(LabelGangNum, YxUtiles.GetShowNumber(_gangNum).ToString());
            YxTools.TrySetComponentValue(LabelTotalScore, YxUtiles.GetShowNumber(_totalNum).ToString());
            HeadTexture.mainTexture = player.CurrentInfoPanel.UserIcon.mainTexture;
            player.UserInfo.Gold    = totalGold;
            player.CurrentInfoPanel.SetGold((int)totalGold);
            HuLogo.SetActive(IsWiner);

            #endregion

            _resultCards.Init(groups, handCards, huList, _isWiner);
            LabelFanName.ProcessText();
            NGUIText.Update();
        }
示例#2
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
        }
示例#3
0
        public ResultInfoData(ISFSObject data, List <int> handCards)
        {
            _data = data;
            ISFSArray Groups;

            FenZhangCard = 0;
            GameTools.TryGetValueWitheKey(data, out HuType, RequestKey.KeyType);
            GameTools.TryGetValueWitheKey(data, out HuNumber, RequestKey.KeyHuNum);
            GameTools.TryGetValueWitheKey(data, out GangNum, RequestKey.KeyGangNum);
            GameTools.TryGetValueWitheKey(data, out FanName, RequestKey.KeyHuName);
            GameTools.TryGetValueWitheKey(data, out NowRoundScore, RequestKey.KeyGold);
            GameTools.TryGetValueWitheKey(data, out TotalGold, RequestKey.KeyTotalGold);
            GameTools.TryGetValueWitheKey(data, out Groups, RequestKey.KeyGroups);
            GameTools.TryGetValueWitheKey(data, out UserSeat, RequestKey.KeySeat);
            GameTools.TryGetValueWitheKey(data, out GuoDanSocre, RequestKey.KeyDanScore);
            GameTools.TryGetValueWitheKey(data, out QingFengScore, RequestKey.KeyQingfengScore);
            IsWiner       = HuType > 0;
            IsZimo        = HuType.Equals(2);
            HandList      = handCards;
            MahjongGroups = GameTools.GetGroupData(Groups);
        }