目录

RankingVariant类主要用于返回当前玩家在排行榜中特定时间维度的分数信息,在调用Ranking类的getRankingVariants方法时会返回该类型的实例。

Constant Summary

typenamedescription

static final int

NUM_SCORES_UNKNOWN排行榜总分数未知。
static final intPLAYER_RANK_UNKNOWN玩家在排行榜名次未知。
static final intPLAYER_SCORE_UNKNOWN玩家分数未知。
static final intNUM_TIME_DIMENSION排行榜时间维度的个数。
static final intTIME_DIMENSION_DAILY日排行。
static final intTIME_DIMENSION_WEEKLY周排行。
static final intTIME_DIMENSION_ALL_TIME总排行。

Public Method Summary

Return

Method

abstract String

getDisplayRanking()

获取用于展示的玩家名次对应的本地化数字,仅当hasPlayerInfo()为true时才返回。

abstract String

getPlayerDisplayScore()

获取用于展示的玩家分数对应的本地化数字,仅当hasPlayerInfo()为true时才返回。

abstract long

getRankTotalScoreNum()

获取排行榜的总分数。

abstract long

getPlayerRank()

获取玩家在该排行榜的名次,仅当hasPlayerInfo()为true时才返回。

abstract String

getPlayerScoreTips()

获取玩家分数的自定义单位,仅当当hasPlayerInfo()为true且存在自定义单位时才返回。

abstract long

getPlayerRawScore()

获取玩家分数的原始分值,仅当hasPlayerInfo()为true时才返回。

abstract int

timeDimension()

玩家当前排名的时间维度。

abstract boolean

hasPlayerInfo()

排行榜中是否有当前玩家。

Constants 

public static final int NUM_SCORES_UNKNOWN

排行榜总分数未知。

常量值:-1

public static final int PLAYER_RANK_UNKNOWN

玩家在排行榜名次未知。

常量值:-2

public static final int PLAYER_SCORE_UNKNOWN

玩家分数未知。

常量值:-3

public static final int NUM_TIME_DIMENSION

排行榜时间维度的个数。

常量值:3

public static final int TIME_DIMENSION_DAILY

日排行。

常量值:0

public static final int TIME_DIMENSION_WEEKLY

周排行。

常量值:1

public static final int TIME_DIMENSION_ALL_TIME

所有时间排行榜。

常量值:2

Public Methods

public abstract String getDisplayRanking()

获取用于展示的玩家名次对应的本地化数字,仅当hasPlayerInfo()为true时才返回。

返回值

Type

Description

String

获取用于展示的玩家名次对应的本地化数字,仅当hasPlayerInfo()为true时才返回。

 public abstract String getPlayerDisplayScore()

获取用于展示的玩家分数对应的本地化数字,仅当hasPlayerInfo()为true时才返回。

返回值

Type

Description

String

获取用于展示的玩家分数对应的本地化数字,仅当hasPlayerInfo()为true时才返回。

public abstract long getRankTotalScoreNum()

获取排行榜的总分数。

返回值

Type

Description

long

排行榜总分数。

public abstract long getPlayerRank()

获取玩家在该排行榜的名次,仅当hasPlayerInfo()为true时才返回。

返回值

Type

Description

long

获取玩家在该排行榜的名次,仅当hasPlayerInfo()为true时才返回。

public abstract String getPlayerScoreTips()

获取玩家分数的自定义单位。只有设置了自定义单位的分数才能获取。

返回值

Type

Description

String

玩家分数的自定义单位,仅当当hasPlayerInfo()为true且存在自定义单位时才返回。

 public abstract long getPlayerRawScore()

获取分数的原始分值。

返回值

Type

Description

long

分数的原始分值,仅当hasPlayerInfo()为true时才返回。

 public abstract int timeDimension()

获取排行榜的时间维度。

返回值

Type

Description

int

时间维度。

  • 0:当天

  • 1:本周

  • 2:全部时间

public abstract boolean hasPlayerInfo()

查询排行榜中是否有当前玩家。

返回值

Type

Description

boolean

排行榜中是否有当前玩家。

  • true:有

  • false:没有