Class MultiMask<T>
java.lang.Object
me.hsgamer.hscore.minecraft.gui.mask.MultiMask<T>
- Type Parameters:
T- the type of the return value of the child element
- All Implemented Interfaces:
Function<@NotNull InventoryContext,,@Nullable Map<Integer, ActionItem>> GUIElement
- Direct Known Subclasses:
AnimatedMask,HybridMask,ListMask,MultiSlotsMask,OneTimeAnimatedMask
public abstract class MultiMask<T>
extends Object
implements GUIElement, Function<@NotNull InventoryContext,@Nullable Map<Integer,ActionItem>>
A base mask that handles multiple child elements
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<Function<@NotNull InventoryContext, @Nullable T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R extends Function<@NotNull InventoryContext,@Nullable T>>
voidadd(Collection<R> elements) Add child elementsfinal voidadd(Function<@NotNull InventoryContext, @Nullable T>... elements) Add child elementsfinal List<Function<@NotNull InventoryContext, @Nullable T>> Get the child elementsvoidinit()Initialize the element.protected booleanWhether this mask requires child elementsvoidstop()Stop the element.
-
Field Details
-
elements
-
-
Constructor Details
-
MultiMask
public MultiMask()
-
-
Method Details
-
requireChildElements
protected boolean requireChildElements()Whether this mask requires child elements- Returns:
- true if it requires child elements
-
add
public <R extends Function<@NotNull InventoryContext,@Nullable T>> void add(Collection<R> elements) Add child elements- Type Parameters:
R- the type of the child elements- Parameters:
elements- the child elements
-
add
Add child elements- Parameters:
elements- the child elements
-
getElements
Get the child elements- Returns:
- the child elements
-
init
public void init()Description copied from interface:GUIElementInitialize the element. Should be called before adding to the GUI.- Specified by:
initin interfaceGUIElement
-
stop
public void stop()Description copied from interface:GUIElementStop the element. Should be called after removing from the GUI.- Specified by:
stopin interfaceGUIElement
-