Class Inventory
- java.lang.Object
-
- org.rspeer.game.adapter.Adapter<RSInventory>
-
- org.rspeer.game.adapter.component.inventory.Inventory
-
- Direct Known Subclasses:
Backpack
,Bank
,Equipment
,NullSafeInventory
public class Inventory extends Adapter<RSInventory>
A class for the manipulation of item containers. This includes but is not limited to inventory, bank and equipment. Please note that static lookup methods in this class are null-safe
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Inventory.Format
-
Constructor Summary
Constructors Constructor Description Inventory(RSInventory provider, Inventory.Format format, boolean extractFromProvider, List<ComponentQuery> queries)
Inventory(RSInventory provider, Inventory.Format format, Consumer<Item> function, boolean extractFromProvider, List<ComponentQuery> queries)
-
Method Summary
-
Methods inherited from class org.rspeer.game.adapter.Adapter
getProvider, validate
-
-
-
-
Constructor Detail
-
Inventory
public Inventory(RSInventory provider, Inventory.Format format, Consumer<Item> function, boolean extractFromProvider, List<ComponentQuery> queries)
-
Inventory
public Inventory(RSInventory provider, Inventory.Format format, boolean extractFromProvider, List<ComponentQuery> queries)
-
-
Method Detail
-
backpack
@Deprecated public static Backpack backpack()
Deprecated.
-
equipment
@Deprecated public static Equipment equipment()
Deprecated.
-
bank
@Deprecated public static Bank bank()
Deprecated.
-
queryOf
@Deprecated public static ItemQuery queryOf(InventoryType type)
Deprecated.
-
queryOf
@Deprecated public static ItemQuery queryOf(InventoryType type, boolean extractFromProvider)
Deprecated.
-
get
@Deprecated public static Inventory get(long key, Inventory.Format format, boolean extractFromProvider, List<ComponentQuery> queries)
Deprecated.
-
get
@Deprecated public static Inventory get(InventoryType composite)
Deprecated.
-
get
@Deprecated public static Inventory get(InventoryType composite, boolean extractFromProvider)
Deprecated.
-
isItemSelected
public static boolean isItemSelected()
-
getSelectedItem
public static Item getSelectedItem()
-
setQueries
public void setQueries(List<ComponentQuery> queries)
-
forceDefaultProvider
public void forceDefaultProvider()
-
setExtractFromProvider
public void setExtractFromProvider(boolean extractFromProvider)
-
interact
public boolean interact(Function<ItemQuery,ItemQueryResults> function, String action)
-
getKey
public long getKey()
-
isUnbound
public boolean isUnbound()
-
getCapacity
public int getCapacity()
-
getEmptySlots
public int getEmptySlots()
-
getCount
public int getCount(Function<ItemQuery,ItemQueryResults> function)
-
getCount
public int getCount(Function<ItemQuery,ItemQueryResults> function, boolean includeStacks)
-
contains
public boolean contains(Function<ItemQuery,ItemQueryResults> function)
-
containsAll
@SafeVarargs public final boolean containsAll(Function<ItemQuery,ItemQueryResults>... functions)
-
isFull
public boolean isFull()
-
isEmpty
public boolean isEmpty()
-
isLoaded
public boolean isLoaded()
-
getItems
public ItemQueryResults getItems()
-
getItems
public ItemQueryResults getItems(Predicate<Item> predicate)
-
getItems
public ItemQueryResults getItems(int... ids)
-
getItems
public ItemQueryResults getItems(String... names)
-
query
public ItemQuery query()
-
-