Class AbstractInventory
java.lang.Object
de.ellpeck.rockbottom.api.inventory.AbstractInventory
- All Implemented Interfaces:
IInventory,Iterable<ItemInstance>
- Direct Known Subclasses:
Inventory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(int id, int amount) add(ItemInstance instance, boolean simulate) voidaddChangeCallback(BiConsumer<IInventory, Integer> callback) addExistingFirst(ItemInstance instance, boolean simulate) addToSlot(int slot, ItemInstance instance, boolean simulate) booleancontainsItem(ItemInstance inst) booleancontainsResource(IUseInfo info) voidfillRandomly(Random random, List<ItemInstance> items) intgetItemIndex(ItemInstance inst) intiterator()voidnotifyChange(int slot) remove(int id, int amount) voidremoveChangeCallback(BiConsumer<IInventory, Integer> callback) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.ellpeck.rockbottom.api.inventory.IInventory
containsInv, get, getActualSlot, getSlotAmount, setMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
callbacks
-
-
Constructor Details
-
AbstractInventory
public AbstractInventory()
-
-
Method Details
-
add
- Specified by:
addin interfaceIInventory
-
remove
- Specified by:
removein interfaceIInventory
-
notifyChange
public void notifyChange(int slot) - Specified by:
notifyChangein interfaceIInventory
-
addChangeCallback
- Specified by:
addChangeCallbackin interfaceIInventory
-
removeChangeCallback
- Specified by:
removeChangeCallbackin interfaceIInventory
-
addToSlot
- Specified by:
addToSlotin interfaceIInventory
-
add
- Specified by:
addin interfaceIInventory
-
addExistingFirst
- Specified by:
addExistingFirstin interfaceIInventory
-
fillRandomly
- Specified by:
fillRandomlyin interfaceIInventory
-
containsItem
- Specified by:
containsItemin interfaceIInventory
-
getItemIndex
- Specified by:
getItemIndexin interfaceIInventory
-
getNextFreeIndex
public int getNextFreeIndex()- Specified by:
getNextFreeIndexin interfaceIInventory
-
containsResource
- Specified by:
containsResourcein interfaceIInventory
-
iterator
- Specified by:
iteratorin interfaceIterable<ItemInstance>
-