Constructor
new InventoryItemSlot(parentInventory, slotIndex)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
parentInventory |
ClubCrawler.Objects.Inventory.Inventory | the Inventory containing this item slot |
slotIndex |
number | The index of parentInventory.slots where this slot is located |
Members
classRef
- Source:
Properties:
Type | Description |
---|---|
function | The class constructor for the creating object for returning it to the game |
empty
- Source:
Properties:
Type | Description |
---|---|
boolean | Whether this slot is empty or not |
instanceConfig
- Source:
Properties:
Type | Description |
---|---|
Object | The configuration object to pass to a new instance of the game object on creation |
itemType
- Source:
Properties:
Type | Description |
---|---|
string | The item type; weapon, general, or stackable (not fully implemented) |
parentInventory
- Source:
Properties:
Type | Description |
---|---|
ClubCrawler.Objects.Inventory.Inventory | The parent inventory |
quantity
- Source:
Properties:
Type | Description |
---|---|
number | The quantity (for stackable items) |
slotIndex
- Source:
Properties:
Type | Description |
---|---|
number | The index of parentInventory.slots where this slot is located |
Methods
getInstance(additionalConfigopt) → {Object}
- Source:
Gets a new instance of the item referenced in this slot
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
additionalConfig |
Object |
<optional> |
{}
|
Additional configuration option parameters to overwrite stored parameters, if desired |
Returns:
- A new instance of the object stored in this slot
- Type
- Object
loadItem(gameItem)
- Source:
Loads an item into this slot
Parameters:
Name | Type | Description |
---|---|---|
gameItem |
Object | The item to load into the slot. Must be an instance of a class. |
popInstance(additionalConfigopt) → {Object}
- Source:
Gets a new instance of the item referenced in this slot then sets the slot to empty
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
additionalConfig |
Object |
<optional> |
{}
|
Additional configuration option parameters to overwrite stored parameters, if desired |
Returns:
- A new instance of the object stored in this slot
- Type
- Object