目录

The RankingVariant class returns the score information of the current player in a time frame on a leaderboard. An instance of the RankingVariant type is returned when the getRankingVariants method of Ranking is called.

Constant Summary

typenamedescription

static final int

NUM_SCORES_UNKNOWNUnknown total scores on a leaderboard.
static final intPLAYER_RANK_UNKNOWNUnknown rank of a user on a leaderboard.
static final intPLAYER_SCORE_UNKNOWNUnknown score of a player.
static final intNUM_TIME_DIMENSIONNumber of time frames of a leaderboard.
static final intTIME_DIMENSION_DAILYDaily leaderboard.
static final intTIME_DIMENSION_WEEKLYWeekly leaderboard.
static final intTIME_DIMENSION_ALL_TIMEAll-time leaderboard.

Public Method Summary

Return

Method

String

getDisplayRanking()

Obtains the localized number corresponding to a player's rank to be displayed. The number is returned only when hasPlayerInfo() returns true.

String

getPlayerDisplayScore()

Obtains the localized number corresponding to a player's score to be displayed. The number is returned only when hasPlayerInfo() returns true.

long

getRankTotalScoreNum()

Obtains the total score on a leaderboard.

long

getPlayerRank()

Obtains a player's rank on a leaderboard. The rank is returned only when hasPlayerInfo() returns true.

String

getPlayerScoreTips()

Obtains the custom unit for a player's score. The unit is returned only when hasPlayerInfo() returns true and a custom unit exists.

long

getPlayerRawScore()

Obtains a player's raw score. The score is returned only when hasPlayerInfo() returns true.

int

timeDimension()

Obtains the time frame that a player's rank is drawn from.

boolean

hasPlayerInfo()

Checks whether the current player exists on the leaderboard.

Constants 

public static final int NUM_SCORES_UNKNOWN

Unknown total scores on a leaderboard.

Constant value: -1

public static final int PLAYER_RANK_UNKNOWN

Unknown rank of a user on a leaderboard.

Constant value: -2

public static final int PLAYER_SCORE_UNKNOWN

Unknown score of a user.

Constant value: -3

public static final int NUM_TIME_DIMENSION

Number of time frames of a leaderboard.

Constant value: 3

public static final int TIME_DIMENSION_DAILY

Daily leaderboard.

Constant value: 0

public static final int TIME_DIMENSION_WEEKLY

Weekly leaderboard.

Constant value: 1

public static final int TIME_DIMENSION_ALL_TIME

All-time leaderboard.

Constant value: 2

Public Methods

public String getDisplayRanking()

Obtains the localized number corresponding to a player's rank to be displayed. The number is returned only when hasPlayerInfo() returns true.

Return Values

Type

Description

String

Localized number corresponding to a player's rank to be displayed. The number is returned only when hasPlayerInfo() returns true.

 public String getPlayerDisplayScore()

Obtains the localized number corresponding to a player's score to be displayed. The number is returned only when hasPlayerInfo() returns true.

Return Values

Type

Description

String

Localized number corresponding to a player's score to be displayed. The number is returned only when hasPlayerInfo() returns true.

public abstract long getRankTotalScoreNum()

Obtains the total score on a leaderboard.

Return Values

Type

Description

long

Total score on a leaderboard.

public long getPlayerRank()

Obtains a player's rank on a leaderboard. The rank is returned only when hasPlayerInfo() returns true.

Return Values

Type

Description

long

Player's rank on a leaderboard. The rank is returned only when hasPlayerInfo() returns true.

public String getPlayerScoreTips()

Obtains the custom unit for a player's score. The unit can be obtained only after a custom unit is set.

Return Values

Type

Description

String

Custom unit for a player's score. The unit is returned only when hasPlayerInfo() returns true and a custom unit exists.

 public long getPlayerRawScore()

Obtains the raw score of a player.

Return Values

Type

Description

long

Raw score of a player. The score is returned only when hasPlayerInfo() returns true.

 public int timeDimension()

Time frame that a player's rank is drawn from.

Return Values

Type

Description

int

Time frame.

  • 0: daily

  • 1: weekly

  • 2: all-time

public boolean hasPlayerInfo()

Checks whether the current player exists on the leaderboard.

Return Values

Type

Description

boolean

Indicates whether the current player exists on the leaderboard.

  • true: yes

  • false: no