api: add useful utility methods to itemcontainer

This commit is contained in:
Adam
2020-04-21 17:16:32 -04:00
parent 19412ac51c
commit 8f12c2846d

View File

@@ -24,6 +24,9 @@
*/ */
package net.runelite.api; package net.runelite.api;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/** /**
* Represents an inventory that contains items. * Represents an inventory that contains items.
*/ */
@@ -34,5 +37,34 @@ public interface ItemContainer extends Node
* *
* @return the items held * @return the items held
*/ */
@Nonnull
Item[] getItems(); Item[] getItems();
/**
* Gets an item from the container at the given slot.
*
* @param slot
* @return the item
* @see Item
*/
@Nullable
Item getItem(int slot);
/**
* Check if this item container contains the given item
*
* @param itemId
* @return
* @see ItemID
*/
boolean contains(int itemId);
/**
* Counts how many of an item this item container contains
*
* @param itemId
* @return
* @see ItemID
*/
int count(int itemId);
} }