java.lang.Object com.realtime.crossfire.jxclient.items.AbstractItemView com.realtime.crossfire.jxclient.items.FloorView
public class FloorView
Provides a view to all items comprising the current floor view.
If an opened container exists, the floor view consists of the container in the first slot followed by the contained items. Otherwise all objects in location0
are returned.
Field Summary | |
---|---|
private int |
currentFloor
The tag of the currently shown container or 0 if no
container is open. |
private ItemListener |
itemListener
The ItemListener attached to the current floor object. |
private ItemSet |
itemSet
The ItemSet to monitor. |
private ItemSetListener |
itemSetListener
The ItemSetListener for detecting opened or closed containers. |
Constructor Summary | |
---|---|
FloorView(ItemSet itemSet)
Creates a new instance. |
Method Summary | |
---|---|
int |
getCurrentFloor()
Returns the current floor location. |
CfItem |
getItem(int index)
Returns the CfItem in a given slot. |
private int |
getOffset()
Returns the number of non-inventory items to be displayed on the floor. |
int |
getSize()
Returns the number of items. |
private void |
setCurrentFloor(int currentFloor)
Updates the currently opened container that's contents are shown in the floor view. |
Methods inherited from class com.realtime.crossfire.jxclient.items.AbstractItemView |
---|
addLocationListener, addLocationsListener, addModified, addModifiedRange, removeLocationListener, removeLocationsListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int currentFloor
0
if no
container is open.
@NotNull private final ItemListener itemListener
ItemListener
attached to the current floor object.
@NotNull private final ItemSet itemSet
ItemSet
to monitor.
@NotNull private final ItemSetListener itemSetListener
ItemSetListener
for detecting opened or closed containers.
Constructor Detail |
---|
public FloorView(@NotNull ItemSet itemSet)
itemSet
- the item set to useMethod Detail |
---|
public int getCurrentFloor()
0
@Nullable public CfItem getItem(int index)
CfItem
in a given slot.
index
- the slot index
null
if the slot is emptyprivate int getOffset()
public int getSize()
private void setCurrentFloor(int currentFloor)
currentFloor
- the current floor tag