Class InventoryState
java.lang.Object
me.eddie.inventoryguiapi.gui.session.AbstractAttributable
me.eddie.inventoryguiapi.gui.session.InventoryState
- All Implemented Interfaces:
Attributable
Represents the current state of an InventoryGUI page. It keeps track of the currently displayed GUIElements and their positions,
the inventory (Bukkit) being currently displayed and it's title and also if there are pages available after this page.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the currently computed contents of this InventoryState by slotgetElementInSlot(int slot) Retrieve the element currently positioned in a slotgetTitle()Return the title calculated to be used to display this page, or null if none yet existsbooleanWhether or not another page exists after this onevoidsetComputedContentsBySlot(Map<Integer, GUIElement> computedContentsBySlot) voidsetHasNextPage(boolean hasNextPage) Set whether or not another page exists after this onevoidSet the title calculated to be used to display this page, or null if none yet existsMethods inherited from class me.eddie.inventoryguiapi.gui.session.AbstractAttributable
getAttribute, hasAttribute, putAttribute, removeAttribute
-
Constructor Details
-
InventoryState
public InventoryState()Construct a new InventoryState. This will intialize with a null inventory and title and with no next page or contents.
-
-
Method Details
-
getElementInSlot
Retrieve the element currently positioned in a slot- Parameters:
slot- The slot to get the element currently in- Returns:
- The current element in this slot, or null if none
-
getComputedContentsBySlot
Get the currently computed contents of this InventoryState by slot- Returns:
- A copy of the currently computed contents of this InventoryState by slot
-
setComputedContentsBySlot
-
getTitle
Return the title calculated to be used to display this page, or null if none yet exists- Returns:
- The title
-
setTitle
Set the title calculated to be used to display this page, or null if none yet exists- Parameters:
title- The title
-
hasNextPage
public boolean hasNextPage()Whether or not another page exists after this one- Returns:
- True if another page exists after this one, or False if not
-
setHasNextPage
public void setHasNextPage(boolean hasNextPage) Set whether or not another page exists after this one- Parameters:
hasNextPage- True if another page exists after this one, or False if not
-