Class InventoryView
java.lang.Object
com.realtime.crossfire.jxclient.items.AbstractItemView
com.realtime.crossfire.jxclient.items.InventoryView
- All Implemented Interfaces:
ItemView
Provides a view of all items in the current player's inventory.
If no player object is known an empty inventory view is generated.
-
Constructor Summary
ConstructorsConstructorDescriptionInventoryView(@NotNull ItemSet itemSet, @NotNull Comparator<CfItem> comparator) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescription@Nullable CfItemgetItem(int index) Returns theCfItemin a given slot.intgetSize()Returns the number of items.voidsetFilter(@NotNull InventoryFilter filter) Sets theInventoryFilter.Methods inherited from class com.realtime.crossfire.jxclient.items.AbstractItemView
addLocationListener, addLocationsListener, addModified, addModifiedRange, removeLocationListener, removeLocationsListener
-
Constructor Details
-
InventoryView
public InventoryView(@NotNull @NotNull ItemSet itemSet, @NotNull @NotNull Comparator<CfItem> comparator) Creates a new instance.- Parameters:
itemSet- the item set to monitorcomparator- the comparator for sorting
-
-
Method Details
-
getSize
public int getSize()Description copied from interface:ItemViewReturns the number of items.- Returns:
- the number of items
-
getItem
Description copied from interface:ItemViewReturns theCfItemin a given slot.- Parameters:
index- the slot index- Returns:
- the item or
nullif the slot is empty
-
setFilter
Sets theInventoryFilter.- Parameters:
filter- the new inventory filter
-