leaderboardmanager - TogetherGames/Public-Corona-Lua GitHub Wiki

LeaderboardManager

together.LeaderboardManager

Overview

The LeaderboardManager is used for fetching and finding leaderboards that exist for the current game.


Members

table Leaderboards

Stores all the Leaderboards contained in the Manager.


Methods


Add()

Adds a Leaderboard to the internally managed list without persistence.

Note
This method is deprecated

Returns void
Syntax
LeaderboardManager:Add( leaderboard )
Parameters

TogetherLeaderboard leaderboard

Instance of a Leaderboard to add internally

--------------------------------------------------------------------------------

FindByLeaderboardID()

Finds the Leaderboard with the specified LeaderboardID if it exists, otherwise returns nil.

Syntax
LeaderboardManager:FindByLeaderboardID( leaderboardID )
Parameters

number leaderboardID

The ID of the Leaderboard to find

--------------------------------------------------------------------------------

GetCount()

Gets the number of Leaderboards currently managed internally.

Returns number
Syntax
LeaderboardManager:GetCount(  )

Get()

Gets the Leaderboard at the specified index if it exists, otherwise returns nil.

Syntax
LeaderboardManager:Get( index )
Parameters

number index

The index of the Leaderboard to find

--------------------------------------------------------------------------------

IndexOf()

Returns the index of the specified Leaderboard if it exists, otherwise returns nil.

Returns number
Syntax
LeaderboardManager:IndexOf( leaderboard )
Parameters

TogetherLeaderboard leaderboard

Instance of the Leaderboard to find the index of

--------------------------------------------------------------------------------

IndexOfByLeaderboardID()

Returns the index of the Leaderboard with the specified LeaderboardID if it exists, otherwise returns -1.

Returns number
Syntax
LeaderboardManager:IndexOfByLeaderboardID( leaderboardID )
Parameters

number leaderboardID

The ID of the Leaderboard to find the index of

--------------------------------------------------------------------------------

Remove()

Removes a Leaderboard from the internally managed list. This does not delete the leaderboard from the game persistently.

Note
This method is deprecated

Returns void
Syntax
LeaderboardManager:Remove( index )
Parameters

number index

The index of the Leaderboard to be removed

--------------------------------------------------------------------------------

Delete()

Deletes a Leaderboard. Upon success, this will automatically update the internal list.

Returns void
Syntax
LeaderboardManager:Delete( leaderboardID, callbackFunc )
Parameters

number leaderboardID

The ID of the Leaderboard to delete

[function](#) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

GetAll()

Gets all Leaderboards for the current session's Game or a particular User.

Returns void
Syntax
LeaderboardManager:GetAll( getForUserID, callbackFunc )
Parameters

number getForUserID

The ID of the User to retrieve Leaderboards for. Pass 0 to fetch all Leaderboards.

[function](#) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------
⚠️ **GitHub.com Fallback** ⚠️