Class MultiMask<T>

java.lang.Object
io.github.projectunified.craftux.mask.MultiMask<T>
Type Parameters:
T - the type of the child element
All Implemented Interfaces:
Element, Mask
Direct Known Subclasses:
AnimatedMask, HybridMask, ListMask, MultiPositionMask, OneTimeAnimatedMask

public abstract class MultiMask<T> extends Object implements Element, Mask
A base mask that handles multiple child elements
  • Field Details

    • elements

      protected final List<T> 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 T> void add(Collection<R> elements)
      Add child elements
      Type Parameters:
      R - the type of the child elements
      Parameters:
      elements - the child elements
    • add

      @SafeVarargs public final void add(T... elements)
      Add child elements
      Parameters:
      elements - the child elements
    • getElements

      public final List<T> getElements()
      Get the child elements
      Returns:
      the child elements
    • init

      public void init()
      Description copied from interface: Element
      Initialize the element. Should be called before adding to the GUI.
      Specified by:
      init in interface Element
    • stop

      public void stop()
      Description copied from interface: Element
      Stop the element. Should be called after removing from the GUI.
      Specified by:
      stop in interface Element