Method GetQuantity
GetQuantity(string)
Gets the Quantity of an InventoryItem by its InventoryItemDefinition id
Declaration
public static int GetQuantity(string inventoryItemDefinitionId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | inventoryItemDefinitionId | InventoryItemDefinition id of the item's quantity to get |
Returns
| Type | Description |
|---|---|
| int | Quantity of the requested Inventory Item. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The parameter id is null or empty |
GetQuantity(int)
Gets the Quantity of an InventoryItem by its InventoryItemDefinition hash
Declaration
public static int GetQuantity(int inventoryItemDefinitionHash)
Parameters
| Type | Name | Description |
|---|---|---|
| int | inventoryItemDefinitionHash | InventoryItemDefinition hash of the item's quantity to get |
Returns
| Type | Description |
|---|---|
| int | Quantity of the requested Inventory Item. |
Exceptions
| Type | Condition |
|---|---|
| KeyNotFoundException | The hash provided doesn't correspond to a valid item |
GetQuantity(InventoryItem)
Gets the Quantity of an InventoryItem by its reference
Declaration
public static int GetQuantity(InventoryItem inventoryItem)
Parameters
| Type | Name | Description |
|---|---|---|
| InventoryItem | inventoryItem | InventoryItem reference of the item's quantity to get |
Returns
| Type | Description |
|---|---|
| int | Quantity of the requested Inventory Item. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The parameter id is null |