Class: LeaderboardApi

leaderboard.LeaderboardApi

Leaderboard wrapper class. Handles access to leaderboard instances. All of the player IDs are converted automatically to GlobalPlayerId. This makes the ID’s consistent with the Player API as well as future-proof for possible cross-platform leaderboards.

Constructors

constructor

new LeaderboardApi(client): LeaderboardApi

Parameters

Name Type
client Client

Returns

LeaderboardApi

Properties

client

Private client: Client

Methods

getLeaderboard

getLeaderboard(name): Promise<null | Leaderboard>

Get access to a named leaderboard. Returns null if leaderboards are not supported and throws an error if the leaderboards are supported but the named leaderboard is not found.

Parameters

Name Type Description
name string The name of the leaderboard

Returns

Promise<null | Leaderboard>


isSupported

isSupported(): boolean

Are leaderboards supported on current platform.

Returns

boolean


log

log(event, parameters): void

Parameters

Name Type
event string
parameters Object

Returns

void