itemmanager - TogetherGames/Public-Corona-Lua GitHub Wiki
together.ItemManager
The ItemManager is used for fetching and finding items that exist for the current game.
table Items
Stores all the Items contained in the Manager.
Adds an Item to the manager internally without persistence.
Note
This method is deprecated
Returns void
ItemManager:Add( item )
TogetherItem item
Instance of an Item to add internally
--------------------------------------------------------------------------------Finds the Item with the specified ItemID if it exists, otherwise returns nil.
Returns TogetherItem
ItemManager:FindByItemID( itemID )
number itemID
The ID of the Item to find
--------------------------------------------------------------------------------Gets the number of Items currently managed internally.
Returns number
ItemManager:GetCount( )
Gets the Item at the specified index if it exists, otherwise returns nil.
Returns TogetherItem
ItemManager:Get( index )
number index
The index of the Item to find
--------------------------------------------------------------------------------Returns the index of the specified Item if it exists, otherwise returns nil.
Returns number
ItemManager:IndexOf( item )
TogetherItem item
Instance of the Item to find the index of
--------------------------------------------------------------------------------Returns the index of the Item with the specified ItemID if it exists, otherwise returns -1.
Returns number
ItemManager:IndexOfByItemID( itemID )
number itemID
The ID of the Item to find the index of
--------------------------------------------------------------------------------Removes an Item from the internally managed list. This does not delete the Item from the game persistently.
Note
This method is deprecated
Returns void
ItemManager:Remove( index )
number index
The index of the Item to be removed
--------------------------------------------------------------------------------Gets all Items configured in the Game. Upon success, this will automatically update the internal list.
Returns void
ItemManager:GetAll( callbackFunc )
function callbackFunc
The function to call upon completion.
--------------------------------------------------------------------------------