Class PaginatedMask
java.lang.Object
me.hsgamer.hscore.minecraft.gui.mask.BaseMask
me.hsgamer.hscore.minecraft.gui.mask.impl.PaginatedMask
- All Implemented Interfaces:
Mask
,Initializable
- Direct Known Subclasses:
ButtonPaginatedMask
,MaskPaginatedMask
,SequencePaginatedMask
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerateButtons
(@NotNull UUID uuid, @NotNull InventorySize inventorySize) Generate the buttons for the unique idgenerateButtons
(@NotNull UUID uuid, @NotNull InventorySize inventorySize, int pageNumber) Generate the buttons for the unique idprotected int
getAndSetExactPage
(UUID uuid, int page, int pageAmount) Get the exact page from the input page and set it if it's not the sameprotected int
getExactPage
(int page, int pageAmount) Get the exact page from the input pageint
Get the current page for the unique idboolean
isCycle()
Check if this paginated mask allows cycle page (The first page after the last page)void
Set the next page for the unique idvoid
previousPage
(@NotNull UUID uuid) Set the previous page for the unique idvoid
setCycle
(boolean cycle) Set if this paginated mask allows cycle page (The first page after the last page)void
Set the page for the unique idMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.hsgamer.hscore.ui.property.Initializable
init, stop
-
Field Details
-
pageNumberMap
-
cycle
protected boolean cycle
-
-
Constructor Details
-
PaginatedMask
Create a new mask- Parameters:
name
- the name of the mask
-
-
Method Details
-
generateButtons
protected abstract Optional<Map<@NotNull Integer,@NotNull Button>> generateButtons(@NotNull @NotNull UUID uuid, @NotNull @NotNull InventorySize inventorySize, int pageNumber) Generate the buttons for the unique id- Parameters:
uuid
- the unique idinventorySize
- the size of the inventorypageNumber
- the page number- Returns:
- the map contains the slots and the buttons
- See Also:
-
getExactPage
protected int getExactPage(int page, int pageAmount) Get the exact page from the input page- Parameters:
page
- the input pagepageAmount
- the amount of pages- Returns:
- the exact page
-
getAndSetExactPage
Get the exact page from the input page and set it if it's not the same- Parameters:
uuid
- the unique idpage
- the input pagepageAmount
- the amount of pages- Returns:
- the exact page
-
setPage
Set the page for the unique id- Parameters:
uuid
- the unique idpage
- the page
-
getPage
Get the current page for the unique id- Parameters:
uuid
- the unique id- Returns:
- the page number
-
nextPage
Set the next page for the unique id- Parameters:
uuid
- the unique id
-
previousPage
Set the previous page for the unique id- Parameters:
uuid
- the unique id
-
isCycle
public boolean isCycle()Check if this paginated mask allows cycle page (The first page after the last page)- Returns:
- true if it does
-
setCycle
public void setCycle(boolean cycle) Set if this paginated mask allows cycle page (The first page after the last page)- Parameters:
cycle
- true if it does
-
generateButtons
public Optional<Map<@NotNull Integer,@NotNull Button>> generateButtons(@NotNull @NotNull UUID uuid, @NotNull @NotNull InventorySize inventorySize) Description copied from interface:Mask
Generate the buttons for the unique id- Parameters:
uuid
- the unique idinventorySize
- the size of the inventory- Returns:
- the map contains the slots and the buttons
-