Exemplo n.º 1
0
 public void SetInfo(TotalScoreUserInfo userInfo)
 {
     NameLabel.text  = userInfo.UserName;
     ScoreLabel.text = string.Format(ScoreFormat, YxUtiles.ReduceNumber(userInfo.TotalScore));
     gameObject.SetActive(true);
     NameLabel.color = userInfo.UserId == App.GameData.GetPlayerInfo().Id ? Color.yellow : Color.white;
 }
Exemplo n.º 2
0
        public void AddUserInfoToList(ISFSObject userData)
        {
            var userInfo = new TotalScoreUserInfo
            {
                UserName   = userData.GetUtfString(RequestKey.KeyName),
                UserId     = userData.GetInt(RequestKey.KeyId),
                ServerSeat = userData.GetInt(RequestKey.KeySeat),
                TotalScore = userData.ContainsKey(Variation) ? userData.GetLong(Variation) : 0
            };

            if (GetUserInfoById(userInfo.UserId) == null)
            {
                _userInfoList.Add(userInfo);
            }
        }
Exemplo n.º 3
0
        public void OnGetGameResultInfo(ISFSObject gameInfo)
        {
            if (!gameObject.activeSelf)
            {
                return;
            }
            if (!gameInfo.ContainsKey(RequestKey.KeyPlayerList))
            {
                return;
            }
            var gdata = App.GetGameData <TexasGameData>();

            if (!gdata.IsRoomGame)
            {
                return;
            }
            _userInfoList.Clear();
            ISFSArray userDataArray = gameInfo.GetSFSArray(RequestKey.KeyPlayerList);

            foreach (ISFSObject userData in userDataArray)
            {
                if (!userData.ContainsKey("isGiveUp"))
                {
                    continue;
                }
                int serverSeat = userData.GetInt(RequestKey.KeySeat);
                var userInfo   = gdata.GetPlayerInfo(serverSeat, true);
                TotalScoreUserInfo ttUserInfo = new TotalScoreUserInfo
                {
                    TotalScore = userData.GetLong(Variation),
                    ServerSeat = serverSeat,
                    UserName   = userInfo.NickM,
                    UserId     = userInfo.Id
                };
                _userInfoList.Add(ttUserInfo);
            }

            RefreshItems();
            SetBgSize();
        }