public class FloorView extends AbstractItemView
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
location 0
are returned.
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
FloorView(ItemSet itemSet)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addLocationListener, addLocationsListener, addModified, addModifiedRange, removeLocationListener, removeLocationsListener
private int currentFloor
0
if no container is
open.@NotNull private final ItemListener itemListener
ItemListener
attached to the current floor object.@NotNull private final ItemSetListener itemSetListener
ItemSetListener
for detecting opened or closed containers.public FloorView(@NotNull ItemSet itemSet)
itemSet
- the item set to usepublic int getCurrentFloor()
0
@Nullable public CfItem getItem(int index)
CfItem
in a given slot.index
- the slot indexnull
if the slot is emptyprivate int getOffset()
public int getSize()
private void setCurrentFloor(int currentFloor)
currentFloor
- the current floor tag