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 Details

    • InventoryView

      public InventoryView(@NotNull @NotNull ItemSet itemSet, @NotNull @NotNull Comparator<CfItem> comparator)
      Creates a new instance.
      Parameters:
      itemSet - the item set to monitor
      comparator - the comparator for sorting
  • Method Details

    • getSize

      public int getSize()
      Description copied from interface: ItemView
      Returns the number of items.
      Returns:
      the number of items
    • getItem

      @Nullable public @Nullable CfItem getItem(int index)
      Description copied from interface: ItemView
      Returns the CfItem in a given slot.
      Parameters:
      index - the slot index
      Returns:
      the item or null if the slot is empty
    • setFilter

      public void setFilter(@NotNull @NotNull InventoryFilter filter)
      Sets the InventoryFilter.
      Parameters:
      filter - the new inventory filter