Class BaseAnimation

java.lang.Object
dev.triumphteam.gui.animations.impl.BaseAnimation
All Implemented Interfaces:
Animation
Direct Known Subclasses:
InfiniteAnimation, SimpleAnimation

public abstract class BaseAnimation extends Object implements Animation
  • Field Details

    • current

      protected int current
    • gui

      protected BaseGui gui
    • runner

      protected AnimationRunner runner
    • delay

      protected final int delay
    • frames

      protected List<Frame> frames
  • Constructor Details

    • BaseAnimation

      public BaseAnimation(int delay, List<Frame> frames)
  • Method Details

    • reset

      public void reset()
      Description copied from interface: Animation
      Reset to the initial frame
      Specified by:
      reset in interface Animation
    • nextFrame

      @Nullable public @Nullable Frame nextFrame()
      Description copied from interface: Animation
      Go to the next frame
      Specified by:
      nextFrame in interface Animation
      Returns:
      the next frame or null if it is the last frame
    • start

      public void start(BaseGui gui)
      Description copied from interface: Animation
      Start the animation
      Specified by:
      start in interface Animation
      Parameters:
      gui - The gui to apply the animation to
    • getDelay

      public int getDelay()
      Specified by:
      getDelay in interface Animation
      Returns:
      the delay between frames
    • getGui

      public BaseGui getGui()
      Specified by:
      getGui in interface Animation
      Returns:
      the gui that this animation is applyed to
    • getRunnable

      public AnimationRunner getRunnable()
      Specified by:
      getRunnable in interface Animation
      Returns:
      the bukkit runnable that handles frame updates
    • stop

      public void stop()
      Description copied from interface: Animation
      Stops the animation
      Specified by:
      stop in interface Animation
    • onFinish

      public abstract Frame onFinish()
      Returns:
      The frame to return when the animation is finished