Class GUIState
java.lang.Object
me.eddie.inventoryguiapi.gui.session.AbstractAttributable
me.eddie.inventoryguiapi.gui.session.GUIState
- All Implemented Interfaces:
Attributable
This class represents the current state of an InventoryGUI being displayed. It keeps track of all the pages of the GUI and their respective InventoryStates
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExistingInventoryState(int page) Get the InventoryState for the given page, or null if none existsgetOrCreateInventoryState(int page) Get the InventoryState for the given page, creating a new one if none existedbooleanhasInventoryState(int page) Check if an InventoryState exists for a given pagevoidremoveInventoryState(int page) Remove the inventory state for a given pagevoidupdateInventoryState(int page, InventoryState state) Update the inventory state for a given pageMethods inherited from class me.eddie.inventoryguiapi.gui.session.AbstractAttributable
getAttribute, hasAttribute, putAttribute, removeAttribute
-
Constructor Details
-
GUIState
public GUIState()Create a new GUIState
-
-
Method Details
-
getInventoryStatesByPage
-
hasInventoryState
public boolean hasInventoryState(int page) Check if an InventoryState exists for a given page- Parameters:
page- The page to check if an inventory state exists for- Returns:
- True if one exists or false if not
-
getOrCreateInventoryState
Get the InventoryState for the given page, creating a new one if none existed- Parameters:
page- The page to get the state of- Returns:
- The Inventory State
-
removeInventoryState
public void removeInventoryState(int page) Remove the inventory state for a given page- Parameters:
page- The page to remove it for
-
updateInventoryState
Update the inventory state for a given page- Parameters:
page- The page to update the inventory state forstate- The InventoryState of the given page
-
getExistingInventoryState
Get the InventoryState for the given page, or null if none exists- Parameters:
page- The page to get the state of- Returns:
- The Inventory State
-