usergamemanager - TogetherGames/Public-Corona-Lua GitHub Wiki

UserGameManager

together.UserGameManager

Overview

The UserGameManager class is for finding and fetching games played by the user.


Members

table UserGames

Stores all the UserGames contained in the Manager.


Methods


FindByUserGameID()

Finds the UserGame with the specified UserGameID if it exists, otherwise returns nil.

Returns UserGame
Syntax
UserGameManager:FindByUserGameID( userGameID )
Parameters

number userGameID

The ID of the UserGame to find

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

GetCount()

Gets the number of UserGames currently managed internally.

Returns number
Syntax
UserGameManager:GetCount(  )

Get()

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

Syntax
UserGameManager:Get( index )
Parameters

number index

The index of the UserGame to find

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

IndexOf()

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

Returns number
Syntax
UserGameManager:IndexOf( userGame )
Parameters

TogetherUserGame userGame

Instance of the UserGame to retrieve the index of.

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

IndexOfByGameID()

Returns the index of the UserGame with the specified GameID if it exists, otherwise returns -1.

Returns number
Syntax
UserGameManager:IndexOfByGameID( gameID )
Parameters

number gameID

The ID of the Game to find the index of.

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

Remove()

Removes a UserGame from the internally managed list. This does not delete the user game from the user's account persistently.

Note
This method is deprecated

Returns void
Syntax
UserGameManager:Remove( index )
Parameters

number index

The index of the UserGame to be removed.

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

GetAll()

Gets all UserGames played by the User. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserGameManager:GetAll( callbackFunc )
Parameters

function callbackFunc

The function to call upon completion.

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