22 package com.realtime.crossfire.jxclient.items;
24 import org.jetbrains.annotations.NotNull;
25 import org.jetbrains.annotations.Nullable;
53 @SuppressWarnings(
"FieldCanBeLocal")
57 public void itemAdded(@NotNull
final CfItem item) {
62 public void itemMoved(@NotNull
final CfItem item) {
67 public void itemChanged(@NotNull
final CfItem item) {
72 public void itemRemoved(@NotNull
final CfItem item) {
77 public void playerChanged(@Nullable
final CfItem player) {
82 public void openContainerChanged(
final int tag) {
95 public void itemChanged(
final int tag) {
96 if (currentFloor != 0) {
102 public void itemRemoved(
final int tag) {
107 public void inventoryAdded(
final int tag,
final int index, @NotNull
final CfItem item) {
113 public void inventoryRemoved(
final int tag,
final int index) {
145 if (this.currentFloor == currentFloor) {
149 final int prevLastIndex =
getSize()-1;
153 final int nextLastIndex =
getSize()-1;
172 if (currentFloor == 0) {
192 return currentFloor == 0 ? 0 : 1;
int getSize()
Returns the number of items.the number of items
final ItemSetListener itemSetListener
The ItemSetListener for detecting opened or closed containers.
CfItem getInventoryItem(final int tag, final int index)
Returns a CfItem from the inventory of an item.
int currentFloor
The tag of the currently shown container or.
int getNumberOfItemsByLocation(final int location)
Returns the number of items in a given location.
Interface for listeners for changes of item locations.
void addModified(final int index)
Marks a slot as modified.
CfItem getItemByTag(final int tag)
Returns an item by tag.
void removeInventoryListener(final int tag, @NotNull final ItemListener listener)
Removes an ItemListener to be notified about changes.
void setCurrentFloor(final int currentFloor)
Updates the currently opened container that's contents are shown in the floor view.
CfItem getItem(final int index)
Returns the CfItem in a given slot.the slot index the item ornull if the slot is empty ...
Interface for listeners in ItemSet related events.
void addModifiedRange(final int firstIndex, final int lastIndex)
Marks a range of slots as modified.
void addInventoryListener(final int tag, @NotNull final ItemListener listener)
Adds an ItemListener to be notified about changes.
final ItemListener itemListener
The ItemListener attached to the current floor object.
final ItemSet itemSet
The ItemSet to monitor.
Abstract base class for ItemView implementing classes.
Model class maintaining the CfItems known to the player.
The representation of a Crossfire Item, client-side.
int getCurrentFloor()
Returns the current floor location.
FloorView(@NotNull final ItemSet itemSet)
Creates a new instance.
Provides a view to all items comprising the current floor view.
int getOffset()
Returns the number of non-inventory items to be displayed on the floor.