-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem_instance.lua
31 lines (27 loc) · 1.26 KB
/
item_instance.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---@meta _
--- An `ItemInstance` is any instance of an [Item](https://saturnyoshi.gitlab.io/RoRML-Docs/class/item.html) object.
---
---@class ItemInstance: Instance
local ItemInstance = {}
--- # Example
--- Get the [Item](https://saturnyoshi.gitlab.io/RoRML-Docs/class/item.html) that the instance stored in variable `instance` was created from.
--- ```lua
--- local item = instance:getItem()
--- ```
---
---@return Item '' The Item which the instance represents
function ItemInstance:getItem() end
--- Used to get the item instance's mod data table.
---
--- This table can be used to store any arbitrary information,
--- there are absolutely no limitations on what keys or values can be stored here.
---
--- When storing custom information, it is preferable to use this over the instance's
--- get and set methods for several reasons:
--- * There are no limitations for what can be stored here.
--- This includes nested tables, non-string keys, or even other Lua objects.
--- * The get and set methods have significant overhead, while instance data has none.
--- * The table is also specific to each mod, so mods are less likely to conflict.
---
---@return ItemInstanceModData '' The mod-specific unique data table for the item instance
function ItemInstance:getData() end