TogetherLeaderboard - TogetherGames/Public-Corona-Lua GitHub Wiki

TogetherLeaderboard

Together::TogetherLeaderboard

Overview

The Leaderboard class represents a together Leaderboard.


Members

number LeaderboardID

The ID of the Leaderboard.

number CreatorUserID

The ID of the User that created the GameInstance the Leaderboard is based on.

number RoomID

The ID of the Room the original GameInstance.

number SecondsSinceStart

The number of seconds since the original GameInstance was started.

number SecondsSinceFinish

The number of seconds since the original GameInstance was finished.

number MaxUsers

The max number of users in the original GameInstance.

number TurnIndex

The index of whose turn it last was.

number WinningUserID

The ID of the User that won the original GameInstance.

table LeaderboardUsers

Contains all the LeaderboardUsers that were playing the original GameInstance.


Methods


GetLeaderboardUserCount()

Gets the number of LeaderboardUsers currently managed internally.

Returns number
Syntax
TogetherLeaderboard:GetLeaderboardUserCount(  )

GetLeaderboardUser()

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

Syntax
TogetherLeaderboard:GetLeaderboardUser( index )
Parameters

number index

The index of the LeaderboardUser to find

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

SortBy()

Sorts the list of LeaderboardUsers by the specified property.

Returns void
Syntax
TogetherLeaderboard:SortBy( propertyName )
Parameters

string propertyName

The name of the property to sort the list of LeaderboardUsers by

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

GetWinningLeaderboardUser()

Gets the LeaderboardUser that had won the original GameInstance if it exists, otherwise returns nil.

Syntax
TogetherLeaderboard:GetWinningLeaderboardUser(  )

GetDetails()

Gets the Leaderboard's details.

Returns void
Syntax
TogetherLeaderboard:GetDetails( friendsOnly, callbackFunc )
Parameters

boolean friendsOnly

A boolean indicating whether only Together friend Users should be retrieve.

[function](#) callbackFunc

The function to call upon completion.

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