private GameWebAPI.RequestCL_Ranking GetRequestRanking(int colosseumId, int begin, int end, bool isUpdate) { return(new GameWebAPI.RequestCL_Ranking { SetSendData = delegate(GameWebAPI.CL_Req_Ranking param) { param.colosseumId = colosseumId; param.begin = begin; param.end = end; }, OnReceived = delegate(GameWebAPI.RespDataCL_Ranking response) { if (isUpdate) { List <GameWebAPI.RespDataCL_Ranking.RankingData> list = new List <GameWebAPI.RespDataCL_Ranking.RankingData>(); list = this.colosseumRankingList.rankingMember.ToList <GameWebAPI.RespDataCL_Ranking.RankingData>(); list.AddRange(response.rankingMember.ToList <GameWebAPI.RespDataCL_Ranking.RankingData>()); if (list.Count == 0) { this.colosseumRankingList.rankingMember = new GameWebAPI.RespDataCL_Ranking.RankingData[0]; } else { this.colosseumRankingList.rankingMember = list.ToArray(); } } else { this.colosseumRankingList = response; this.DataSetting(); } } }); }
private void DataSetting() { GameWebAPI.RespDataCL_Ranking respDataCL_Ranking = this.colosseumRankingList; if (this.dispRankingType == CMD_ColosseumRanking.ColosseumRankingType.THIS_TIME) { respDataCL_Ranking.pointRankingList["-1"] = 0; } if (respDataCL_Ranking.pointRankingList == null) { this.keysList = new List <string>(); this.valsList = new List <int>(); this.keysListStartValue = new List <string>(); this.listIdx = this.keysList.Count - 1; this.amIOutRange = true; this.limitRank = 0; respDataCL_Ranking.pointToNextRank = 0; return; } this.keysList = new List <string>(respDataCL_Ranking.pointRankingList.Keys); this.valsList = new List <int>(respDataCL_Ranking.pointRankingList.Values); this.keysListStartValue = new List <string>(); this.keysListStartValue.Add("1"); for (int i = 1; i < respDataCL_Ranking.pointRankingList.Count; i++) { int num = int.Parse(this.keysList[i - 1]) + 1; this.keysListStartValue.Add(num.ToString()); } if (respDataCL_Ranking.myRankingNo > 0) { for (int j = 0; j < this.keysList.Count; j++) { if (respDataCL_Ranking.myRankingNo > int.Parse(this.keysList[j]) && int.Parse(this.keysList[j]) > 0) { this.listIdx = j + 1; } } if (int.Parse(this.keysList[this.keysList.Count - 2]) < respDataCL_Ranking.myRankingNo) { this.listIdx = this.keysList.Count - 1; this.amIOutRange = true; } else { this.amIOutRange = false; } } else { this.listIdx = this.keysList.Count - 1; this.amIOutRange = true; } this.limitRank = int.Parse(this.keysList[this.keysList.Count - 2]); if (this.listIdx == 0) { respDataCL_Ranking.pointToNextRank = 0; } }
public void SetData(GameWebAPI.RespDataCL_Ranking data) { if (data.rankingMember != null) { GUISelectPanelColosseumRanking.partsDataList = data.rankingMember.ToList <GameWebAPI.RespDataCL_Ranking.RankingData>(); } else { GUISelectPanelColosseumRanking.partsDataList = new List <GameWebAPI.RespDataCL_Ranking.RankingData>(); } }