Show / Hide Table of Contents

Class ISN_GKLeaderboard

An object used to read data from a leaderboard stored on Game Center.

Inheritance
System.Object
ISN_GKLeaderboard
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: SA.iOS.GameKit
Assembly: cs.temp.dll.dll
Syntax
public class ISN_GKLeaderboard

Properties

GroupIdentifier

The identifier for the group the leaderboard is part of.

If your game was configured to be part of a group in iTunes Connect, this property holds the identifier you assigned to the group.

Declaration
public string GroupIdentifier { get; set; }
Property Value
Type Description
System.String

The group identifier.

Identifier

The named leaderboard to retrieve information from.

If not empty, Game Center only returns scores from the matching leaderboard. If empty, all scores previously reported by the game are searched. Default is System.String.Empty.

Declaration
public string Identifier { get; set; }
Property Value
Type Description
System.String

Loading

A Boolean value that indicates whether the leaderboard object is retrieving scores. The value of the loading property is true if the leaderboard object has any pending requests for scores.

Declaration
public bool Loading { get; }
Property Value
Type Description
System.Boolean

LocalPlayerScore

The score earned by the local player.

This property is invalid until a call to LoadScores(Action<ISN_GKScoreLoadResult>)is completed. Afterward, it contains a score object representing the local player’s score on the leaderboard given the filters you applied to the query.

Declaration
public ISN_GKScore LocalPlayerScore { get; }
Property Value
Type Description
ISN_GKScore

MaxRange

The size of the leaderboard.

This property is invalid until a call to LoadScores(Action<ISN_GKScoreLoadResult>) is completed. Afterward, it contains the total number of entries available to return to your game given the filters you applied to the query.

Declaration
public long MaxRange { get; }
Property Value
Type Description
System.Int64

PlayerScope

A filter used to restrict the search to a subset of the players on Game Center.

The playerScope property is ignored if the leaderboard request was initialized using the initWithPlayerIDs: method. Otherwise, the playerScope property determines which players are included in the request for high scores. The default is Global. See ISN_GKLeaderboardPlayerScope for more information.

Declaration
public ISN_GKLeaderboardPlayerScope PlayerScope { get; set; }
Property Value
Type Description
ISN_GKLeaderboardPlayerScope

Range

The numerical score rankings to return from the search.

The range property is ignored if the leaderboard request was initialized using the initWithPlayerIDs: method. Otherwise, the range property is used to filter which scores are returned to your game. For example, if you specified a range of [1,10], after the search is complete, your game receives the best ten scores. The default range is [1,25].

The minimum index is 1. The maximum length is 100.

Declaration
public ISN_NSRange Range { get; set; }
Property Value
Type Description
ISN_NSRange

Scores

An array of GKScore objects that contains the scores returned by the search.

This property is invalid until a call to LoadScores(Action<ISN_GKScoreLoadResult>) is complete. Afterward, it contains the same score objects that were returned to the completion handler.

Declaration
public List<ISN_GKScore> Scores { get; }
Property Value
Type Description
List<ISN_GKScore>

TimeScope

A filter used to restrict the search to scores that were posted within a specific period of time.

This property determines how far back in time to look for scores. The default value is AllTime. See ISN_GKLeaderboardTimeScope for more information.

Declaration
public ISN_GKLeaderboardTimeScope TimeScope { get; set; }
Property Value
Type Description
ISN_GKLeaderboardTimeScope

Title

The localized title for the leaderboard.

If you initialized a new leaderboard object, this property is invalid until a call to LoadScores(Action<ISN_GKScoreLoadResult>) is complete. Afterward, it contains the localized title for the leaderboard identified by the category property.

Declaration
public string Title { get; set; }
Property Value
Type Description
System.String

Methods

LoadLeaderboards(Action<ISN_GKLeaderboardsResult>)

Loads the list of leaderboards from Game Center Use this class method to retrieve the list of leaderboards you configured on iTunes Connect.

Declaration
public static void LoadLeaderboards(Action<ISN_GKLeaderboardsResult> callback)
Parameters
Type Name Description
Action<ISN_GKLeaderboardsResult> callback

A block that is called when the categories have been retrieved from the server.

LoadScores(Action<ISN_GKScoreLoadResult>)

Retrieves a set of scores from Game Center.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

Declaration
public void LoadScores(Action<ISN_GKScoreLoadResult> callback)
Parameters
Type Name Description
Action<ISN_GKScoreLoadResult> callback

A block to be called after the scores are retrieved from the server.

In This Article
Back to top Generated by DocFX