Method AddItem
AddItem(int, int)
Adds a new entry of the specified InventoryItemDefinition by Hash. Returns the new (or existing) reference to the instance. Returns the new reference to the instance when the item didn't already exist in the Inventory and returns an existing reference when to the instance when the Item was already in the Inventory. Items added to the wallet Inventory must contain an attached CurrencyDetailDefinition.
Declaration
public override InventoryItem AddItem(int itemDefinitionHash, int quantity = 1)
Parameters
Type | Name | Description |
---|---|---|
int | itemDefinitionHash | The Hash of the InventoryItemDefinition to set. |
int | quantity | The new quantity for the specified InventoryItemDefinition. |
Returns
Type | Description |
---|---|
InventoryItem | The new or existing instance of the InventoryItem. |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException |