예제 #1
0
        public void LoadTopScores(string leaderboardCode, TaskCompletionSource <Dictionary <string, List <WaveEngine.Social.LeaderboardScore> > > tcs)
        {
            var customLeaderboardsCallback = new CustomLeaderBoardsCallback(tcs);

            var pendingResult = GamesClass.Leaderboards.LoadTopScores(client, leaderboardCode, 2, 0, 25);

            pendingResult.SetResultCallback(customLeaderboardsCallback);
        }
        /// <summary>
        /// Loads the player-centered page of scores for a given leaderboard. If the player does not have a score on this leaderboard, this call will return the top page instead.
        /// </summary>
        /// <param name="leaderboardCode">The leaderboard code.</param>
        /// <param name="count">The maximum number of scores. Must be between 1 and 25.</param>
        /// <param name="socialOnly">If <c>true</c>, the result will only contain the scores of players in the viewing player's circles.</param>
        /// <param name="forceReload">If <c>true</c>, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to false to gain advantages of data caching.</param>
        /// <param name="tcs">The TCS.</param>
        public void LoadPlayerCenteredScores(string leaderboardCode, int count, bool socialOnly, bool forceReload, TaskCompletionSource <IEnumerable <WaveEngine.Social.LeaderboardScore> > tcs)
        {
            var leaderboardCollection = socialOnly ? LeaderboardVariant.CollectionSocial : LeaderboardVariant.CollectionPublic;

            var customLeaderboardsCallback = new CustomLeaderBoardsCallback(tcs);
            var pendingResult = GamesClass.Leaderboards.LoadPlayerCenteredScores(this.client, leaderboardCode, LeaderboardVariant.TimeSpanAllTime, leaderboardCollection, count, forceReload);

            pendingResult.SetResultCallback(customLeaderboardsCallback);
        }
예제 #3
0
        /// <summary>
        /// Loads the top page of scores for a given leaderboard.
        /// </summary>
        /// <param name="leaderboardCode">The leaderboard code.</param>
        /// <param name="count">The maximum number of scores. Must be between 1 and 25.</param>
        /// <param name="socialOnly">If <c>true</c>, the result will only contain the scores of players in the viewing player's circles.</param>
        /// <param name="forceReload">If <c>true</c>, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to false to gain advantages of data caching.</param>
        /// <param name="tcs">The TCS.</param>
        public void LoadTopScores(string leaderboardCode, int count, bool socialOnly, bool forceReload, TaskCompletionSource<IEnumerable<WaveEngine.Social.LeaderboardScore>> tcs)
        {
            var leaderboardCollection = socialOnly ? LeaderboardVariant.CollectionSocial : LeaderboardVariant.CollectionPublic;

            var customLeaderboardsCallback = new CustomLeaderBoardsCallback(tcs);
            var pendingResult = GamesClass.Leaderboards.LoadTopScores(this.client, leaderboardCode, LeaderboardVariant.TimeSpanAllTime, leaderboardCollection, count, forceReload);
            pendingResult.SetResultCallback(customLeaderboardsCallback);
        }