/// <summary> /// 初始化总结算成员 /// </summary> /// <param name="data">总结算成员信息</param> public virtual void InitAccItem(Sfs2X.Entities.Data.ISFSObject data) { var gdata = App.GetGameData <FillpitGameData>(); _winTimesValue.text = data.GetInt("win").ToString(); //获取胜利次数 _lostTimesValue.text = data.GetInt("lost").ToString(); //获取失败次数 PlayerScore = data.GetInt("gold"); _allScore.text = YxUtiles.GetShowNumberForm(PlayerScore, 0, "N0"); //App.GetGameData<GlobalData>().GetShowGold(PlayerScore); //获取总分数 if (data.ContainsKey("seat")) { int seat = data.GetInt("seat"); var player = gdata.GetPlayerInfo(seat, true) ?? gdata.GetLastGamePlayerInfo(seat, true); _playerName.text = player.NickM; PortraitDb.SetPortrait(player.AvatarX, _headImage, player.SexI); if (seat == gdata.SelfSeat) { SetNameLabelColor(0xffff00); } int id = data.GetInt("id"); _owerMark.SetActive(gdata.IsRoomGame && id == gdata.OwnerId); if (gdata.SelfSeat == seat) { IsMyself(); } } }
/// <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); } }
public override void SetResultItem(Sfs2X.Entities.Data.ISFSObject user, YxBaseUserInfo userInfo) { _winGold = user.GetInt("gold"); _score.text = YxUtiles.ReduceNumber(_winGold); PlayerName = user.GetUtfString("nick"); SetLordMark(userInfo.Id == 0); SetBigWinnerMark(false); gameObject.SetActive(true); PortraitDb.SetPortrait(userInfo.AvatarX, HeadImage, userInfo.SexI); //设置头像 if (_winTimeLabel != null) { _winTimeLabel.text = user.GetInt("win").ToString(); } if (_lostTimeLabel != null) { _lostTimeLabel.text = user.GetInt("lost").ToString(); } }
/// <summary> /// 展示房间信息 /// </summary> /// <param name="gameInfo"></param> public void ShowRoomInfo(Sfs2X.Entities.Data.ISFSObject gameInfo) { if (gameInfo.ContainsKey("rid")) { _roomId = gameInfo.GetInt("rid"); _roomIdLabel.text = string.Format("{0}", _roomId); _roomIdLabel.gameObject.SetActive(true); } //设置局数信息 if (gameInfo.ContainsKey("maxRound")) { _maxRound = gameInfo.GetInt("maxRound"); _curRound = gameInfo.GetInt("round"); RefreshRoundInfo(); } //设置轮数信息 if (gameInfo.ContainsKey("maxfpround")) { _maxTurn = gameInfo.GetInt("maxfpround"); _curTurn = gameInfo.GetInt("fpround"); RefreshTurnInfo(); } string rule = string.Empty; //游戏规则 if (gameInfo.ContainsKey("rule")) { rule = gameInfo.GetUtfString("rule"); InitRuleInfo(rule); } gameObject.SetActive(true); InitInvitBtn(rule); //初始化微信邀请按钮 RefreshRoomInfo(); }
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); } }
/// <summary> /// 初始化总结算成员 /// </summary> /// <param name="data">总结算成员信息</param> public void InitAccItem(Sfs2X.Entities.Data.ISFSObject data) { _winTimesValue.text = data.GetInt("win").ToString(); //获取胜利次数 _lostTimesValue.text = data.GetInt("lost").ToString(); //获取失败次数 PlayerScore = data.GetInt("gold"); //获取玩家的得分 _allScore.text = PlayerScore.ToString(); //获取总分数 if (data.ContainsKey("seat")) { int seat = data.GetInt("seat"); var gdata = App.GameData; DuifenPlayerPanel panel = gdata.GetPlayer <DuifenPlayerPanel>(seat, true); _playerName.text = panel.Info.NickM; _headImage.SetTexture(panel.HeadPortrait.GetTexture()); if (seat == gdata.SelfSeat) { SetNameLabelColor(0xffff00); } _owerMark.SetActive(seat == 0); } }
/// <summary> /// 展示房间信息 /// </summary> /// <param name="gameInfo"></param> public void ShowRoomInfo(Sfs2X.Entities.Data.ISFSObject gameInfo) { if (gameInfo.ContainsKey("rid")) { _roomID = gameInfo.GetInt("rid"); _roomIdLabel.text = _roomID.ToString(); _roomIdLabel.gameObject.SetActive(true); } //设置局数信息 if (gameInfo.ContainsKey("maxRound")) { _maxRound = gameInfo.GetInt("maxRound"); _curRound = gameInfo.GetInt("round"); RefreshRoundInfo(); } //设置轮数信息 if (gameInfo.ContainsKey("maxfpround")) { _maxTurn = gameInfo.GetInt("maxfpround"); _curTurn = gameInfo.GetInt("fpround"); RefreshTurnInfo(); } //游戏规则 if (gameInfo.ContainsKey("rule")) { InitRuleInfo(gameInfo.GetUtfString("rule")); } gameObject.SetActive(true); RefreshRoomInfo(); //InitInvitBtn(); //初始化微信邀请按钮 }