Data interface representing a single score on a leaderboard.
Constant Summary
int | LEADERBOARD_RANK_UNKNOWN | Constant indicating that the score holder's rank was not known. |
Public Method Summary
abstract void |
getDisplayRank(CharArrayBuffer
dataOut)
Load the formatted display rank into the given
CharArrayBuffer .
|
abstractString |
getDisplayRank()
Retrieves a formatted string to display for this rank.
|
abstractString |
getDisplayScore()
Retrieves a formatted string to display for this score.
|
abstract void |
getDisplayScore(CharArrayBuffer
dataOut)
Loads the formatted display score into the given
CharArrayBuffer .
|
abstract long |
getRank()
Retrieves the rank returned from the server for this score.
|
abstract long |
getRawScore()
Retrieves the raw score value.
|
abstractPlayer |
getScoreHolder()
Retrieves the player that scored this particular score.
|
abstract void |
getScoreHolderDisplayName(CharArrayBuffer
dataOut)
Load the display name of the player who scored this score into the provided
CharArrayBuffer .
|
abstractString |
getScoreHolderDisplayName()
Retrieves the name to display for the player who scored this score.
|
abstractUri |
getScoreHolderHiResImageUri()
Retrieves the URI of the hi-res image to display for the player who scored this
score.
|
abstractUri |
getScoreHolderIconImageUri()
Retrieves the URI of the icon image to display for the player who scored this
score.
|
abstractString |
getScoreTag()
Retrieve the optional score tag associated with this score, if any.
|
abstract long |
getTimestampMillis()
Retrieves the timestamp (in milliseconds from epoch) at which this score was
achieved.
|
Inherited Method Summary
Constants
public static final int LEADERBOARD_RANK_UNKNOWN
Constant indicating that the score holder's rank was not known.
Public Methods
public abstract voidgetDisplayRank(CharArrayBuffer dataOut)
Load the formatted display rank into the givenCharArrayBuffer
.
Parameters
dataOut | The buffer to load the data into. |
---|
public abstractStringgetDisplayRank()
Retrieves a formatted string to display for this rank. This handles appropriate localization and formatting.
Returns
- Formatted string to display.
public abstractStringgetDisplayScore()
Retrieves a formatted string to display for this score. The details of the formatting are specified by the developer in their dev console.
Returns
- Formatted string to display.
public abstract voidgetDisplayScore(CharArrayBuffer dataOut)
Loads the formatted display score into the givenCharArrayBuffer
.
Parameters
dataOut | The buffer to load the data into. |
---|
public abstract longgetRank()
Retrieves the rank returned from the server for this score. Note that this may not be exact and that multiple scores can have identical ranks. Lower ranks indicate a better score, with rank 1 being the best score on the board.
If the score holder's rank cannot be determined, this will return
LEADERBOARD_RANK_UNKNOWN
.
Returns
- Rank of score.
public abstract longgetRawScore()
Retrieves the raw score value.
Returns
- The raw score value.
public abstractPlayer getScoreHolder()
Retrieves the player that scored this particular score. The return value here may be null if the current player is not authorized to see information about the holder of this score.
Note that this object is a volatile representation, so it is not safe to cache the
output of this directly. Instead, cache the result ofFreezable.freeze()
.
Returns
- The player associated with this leaderboard score.
public abstract voidgetScoreHolderDisplayName(CharArrayBuffer dataOut)
Load the display name of the player who scored this score into the provided
CharArrayBuffer
.
Parameters
dataOut | The buffer to load the data into. |
---|
public abstractStringgetScoreHolderDisplayName()
Retrieves the name to display for the player who scored this score. If the identity of the player is unknown, this will return an anonymous name to display.
Returns
- The display name of the holder of this score.
public abstractUrigetScoreHolderHiResImageUri()
Retrieves the URI of the hi-res image to display for the player who scored this score. If the identity of the player is unknown, this will return null. It may also be null if the player simply has no image.
To retrieve the Image from theUri
,use
ImageManager
.
Returns
- The URI of the hi-res image to display for this score.
public abstractUrigetScoreHolderIconImageUri()
Retrieves the URI of the icon image to display for the player who scored this score. If the identity of the player is unknown, this will return an anonymous image for the player. It may also be null if the player simply has no image.
To retrieve the Image from theUri
,use
ImageManager
.
Returns
- The URI of the icon image to display for this score.
public abstractStringgetScoreTag()
Retrieve the optional score tag associated with this score, if any.
Returns
- The score tag associated with this score.
public abstract longgetTimestampMillis()
Retrieves the timestamp (in milliseconds from epoch) at which this score was achieved.
Returns
- Timestamp when this score was achieved.