Class InventoryView
- java.lang.Object
-
- com.realtime.crossfire.jxclient.items.AbstractItemView
-
- com.realtime.crossfire.jxclient.items.InventoryView
-
- All Implemented Interfaces:
ItemView
public class InventoryView extends AbstractItemView
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
Constructors Constructor Description InventoryView(@NotNull ItemSet itemSet, @NotNull java.util.Comparator<CfItem> comparator)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @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
-
-
-
-
Method Detail
-
getSize
public int getSize()
Description copied from interface:ItemViewReturns the number of items.- Returns:
- the number of items
-
getItem
@Nullable public @Nullable CfItem getItem(int index)
Description copied from interface:ItemViewReturns theCfItemin a given slot.- Parameters:
index- the slot index- Returns:
- the item or
nullif the slot is empty
-
setFilter
public void setFilter(@NotNull @NotNull InventoryFilter filter)Sets theInventoryFilter.- Parameters:
filter- the new inventory filter
-
-