achievementmanager - TogetherGames/Public-Corona-Lua GitHub Wiki

AchievementManager

together.AchievementManager

Overview

The AchievementManager is used for fetching and finding achievements that exist for the current game.


Members

table Achievements

Stores all the Achievements contained in the Manager.


Methods


Add()

Adds an Achievement to the manager internally without persistence.

Note
This method is deprecated

Returns void
Syntax
AchievementManager:Add( achievement )
Parameters

TogetherAchievement achievement

Instance of an Achievement to add internally

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

FindByAchievementID()

Finds the Achievement with the specified AchievementID if it exists, otherwise returns nil.

Syntax
AchievementManager:FindByAchievementID( achievementID )
Parameters

number achievementID

The ID of the Achievement to find

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

GetCount()

Gets the number of Achievements currently managed internally.

Returns number
Syntax
AchievementManager:GetCount(  )

Get()

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

Syntax
AchievementManager:Get( index )
Parameters

number index

The index of the Achievement to retrieve internally.

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

IndexOf()

Returns the index of the specified Achievement instance if it exists internally, otherwise returns nil.

Returns number
Syntax
AchievementManager:IndexOf( achievement )
Parameters

TogetherAchievement achievement

Instance of the Achievement to find the index of

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

IndexOfByAchievementID()

Returns the index of the Achievement with the corresponding AchievementID if it exists internally, otherwise returns -1.

Returns number
Syntax
AchievementManager:IndexOfByAchievementID( achievementID )
Parameters

number achievementID

The ID of the Achievement to find the index of

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

Remove()

Removes an Achievement from the internally managed list. This does not delete the Achievement from the game persistently.

Note
This method is deprecated

Returns void
Syntax
AchievementManager:Remove( index )
Parameters

number index

The index of the Achievement to be removed internally

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

GetAll()

Requests a list of the Achievements configured for the current game.

Returns void
Syntax
AchievementManager:GetAll( callbackFunc )
Parameters

function callbackFunc

The function to call upon completion.

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