Exemple #1
0
        /// <summary>
        /// 初始化小结成员的信息
        /// </summary>
        /// <param name="data"></param>
        public void InitSumItem(Sfs2X.Entities.Data.ISFSObject data)
        {
            if (data.ContainsKey("seat"))
            {
                //获取信息
                int seat = data.GetInt("seat");
                var gdata = App.GetGameData<FillpitGameData>();
                var player = gdata.GetPlayerInfo(seat,true);
                if (player == null)
                {
                    gameObject.SetActive(false);
                    return;
                }

                _nameLabel.text = player.NickM;
                PortraitDb.SetPortrait(player.AvatarX, _headImage, player.SexI);

                _winValue = data.GetInt("win");
                _cardsValueLabel.text = _winValue.ToString();
                _cardsValueLabel.text = data.GetInt("cardsValue").ToString();
                _winGoldLabel.text = YxUtiles.ReduceNumber(_winValue);//App.GetGameData<GlobalData>().GetShowGold(_winValue);
                if (_allKillMark != null)
                {
                    bool isAllKill = (gdata.Dkak && (data.ContainsKey("doubleKing") && data.GetBool("doubleKing"))) ||
                                     (gdata.Sfak && (data.ContainsKey("sameFour") && data.GetBool("sameFour")));
                    _allKillMark.SetActive(_winValue > 0 && isAllKill);
                }

                SetUserCards(data.GetIntArray("cards"));
                YxDebug.LogArray(data.GetIntArray("cards"));

                if (data.ContainsKey("isgame") && _foldMark != null)
                {
                    _foldMark.SetActive(!data.GetBool("isgame"));
                }

                if (seat == gdata.SelfSeat)
                {
                    SetLabelColor(0xffff00);
                }
                _owenMark.SetActive(gdata.IsRoomGame && player.Id == gdata.OwnerId);
            }
        }
Exemple #2
0
        public override void Parse(Sfs2X.Entities.Data.ISFSObject userData)
        {
            base.Parse(userData);
            if (userData.ContainsKey(NewRequestKey.KeyRate))
            {
                Rate = userData.GetInt(NewRequestKey.KeyRate);
            }

            if (userData.ContainsKey(NewRequestKey.KeyIsRate))
            {
                IsRate = userData.GetInt(NewRequestKey.KeyIsRate) > 1;
            }

            if (userData.ContainsKey(NewRequestKey.KeyNetWork))
            {
                NetWork = userData.GetBool(NewRequestKey.KeyNetWork);
            }

            if (userData.ContainsKey(NewRequestKey.KeyTrusteeship))
            {
                AutoState = userData.GetBool(NewRequestKey.KeyTrusteeship);
            }
        }