public void ChangeLeaderboardType(LeaderboardType newType) { leaderboardType = newType; title.text = leaderboardType.ToString(); UpdateLeaderboard(leaderboardType); }
public void Start() { for (int i = 0; i < leaderboardEntries.Count; i++) { leaderboardEntries[i].SetPosition(i + 1); } title.text = leaderboardType.ToString(); }
public static string LeaderboardToString(LeaderboardType type) { int t = (int)type; int i = t - 2; if (i >= 0) { return(Brawlers[i]); } else if (t >= 0 && t <= 1) { return(type.ToString().ToLower()); } else { return(null); } }
public async Task <List <LeaderboardItem> > GetLeaderboardAsync(GameType gameType, LeaderboardPlatformType platformType = LeaderboardPlatformType.ALL, LeaderboardType leaderboardType = LeaderboardType.WINS, int entryCount = 100) { if (entryCount > 0 && entryCount <= 100) { var request = new RestRequest("leaderboard/{gameType}/{platformType}/{leaderboardType}", Method.GET); request.AddUrlSegment("gameType", gameType.ToString().ToLower()); request.AddUrlSegment("platformType", platformType.ToString().ToLower()); request.AddUrlSegment("leaderboardType", leaderboardType.ToString().ToLower()); request.AddParameter("rows", entryCount); IRestResponse response = await CODAPI.SendRestRequestAsync(request).ConfigureAwait(false); if (response.ResponseStatus != ResponseStatus.Completed || String.IsNullOrWhiteSpace(response.Content)) { return(null); } return(JObject.Parse(response.Content)["entries"].ToObject <List <LeaderboardItem> >()); } return(null); }
/// <summary> /// Finds a list of GameData with the highest <param name="dataType"/> for each <param name="key"/> provided that matches the <param name="actorId"/> and <param name="gameId"/>. /// </summary> /// <param name="actorId">ID of a User/Group.</param> /// <param name="gameId">ID of a Game.</param> /// <param name="key">Array of Key names.</param> /// <param name="dataType">Data type of value</param> /// <returns>A list of <see cref="EvaluationDataResponse"/> which match the search criteria.</returns> public EvaluationDataResponse GetByLeaderboardType(int actorId, int gameId, string key, EvaluationDataType dataType, LeaderboardType leaderboardType) { var query = GetUriBuilder(ControllerPrefix + "/leaderboardType/{0}/{1}/{2}/{3}/{4}", actorId, gameId, key, dataType.ToString(), leaderboardType.ToString()).ToString(); return(Get <EvaluationDataResponse>(query)); }