Module hanyaeger

Record Class LoopingAnimation

java.lang.Object
java.lang.Record
com.github.hanyaeger.api.entities.LoopingAnimation
All Implemented Interfaces:
Animation

public record LoopingAnimation(int rowStart, int columnStart, int rowEnd, int columnEnd, long cycleTimeInMs) extends Record implements Animation
A LoopingAnimation implements the interface Animation and should be used when the Animation should loop. For different behaviour, look at the other classes that implement Animation.
  • Field Summary

    Fields inherited from interface com.github.hanyaeger.api.entities.Animation

    DEFAULT_AUTOCYCLE_INTERVAL
  • Constructor Summary

    Constructors
    Constructor
    Description
    LoopingAnimation(int rowStart, int columnStart, int rowEnd, int columnEnd)
    Create a new instance of LinkedAnimation
    LoopingAnimation(int rowStart, int columnStart, int rowEnd, int columnEnd, long cycleTimeInMs)
    Creates an instance of a LoopingAnimation record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the columnEnd record component.
    int
    Returns the value of the columnStart record component.
    long
    Returns the value of the cycleTimeInMs record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    A value that states whether this Animation should loop after it has finished.
    int
    Returns the value of the rowEnd record component.
    int
    Returns the value of the rowStart record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.github.hanyaeger.api.entities.Animation

    callback, next
  • Constructor Details

    • LoopingAnimation

      public LoopingAnimation(int rowStart, int columnStart, int rowEnd, int columnEnd)
      Create a new instance of LinkedAnimation
      Parameters:
      rowStart - the 0-based row-index of the first sprite to be shown
      columnStart - the 0-based column-index of the first sprite to be shown
      rowEnd - the 0-based row-index of the last sprite to be shown
      columnEnd - the 0-based column-index of the last sprite to be shown
    • LoopingAnimation

      public LoopingAnimation(int rowStart, int columnStart, int rowEnd, int columnEnd, long cycleTimeInMs)
      Creates an instance of a LoopingAnimation record class.
      Parameters:
      rowStart - the value for the rowStart record component
      columnStart - the value for the columnStart record component
      rowEnd - the value for the rowEnd record component
      columnEnd - the value for the columnEnd record component
      cycleTimeInMs - the value for the cycleTimeInMs record component
  • Method Details

    • loop

      public boolean loop()
      Description copied from interface: Animation
      A value that states whether this Animation should loop after it has finished. Only a LoopingAnimation will return true for this value.
      Specified by:
      loop in interface Animation
      Returns:
      whether this Animation should loop after it has finished
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • rowStart

      public int rowStart()
      Returns the value of the rowStart record component.
      Specified by:
      rowStart in interface Animation
      Returns:
      the value of the rowStart record component
    • columnStart

      public int columnStart()
      Returns the value of the columnStart record component.
      Specified by:
      columnStart in interface Animation
      Returns:
      the value of the columnStart record component
    • rowEnd

      public int rowEnd()
      Returns the value of the rowEnd record component.
      Specified by:
      rowEnd in interface Animation
      Returns:
      the value of the rowEnd record component
    • columnEnd

      public int columnEnd()
      Returns the value of the columnEnd record component.
      Specified by:
      columnEnd in interface Animation
      Returns:
      the value of the columnEnd record component
    • cycleTimeInMs

      public long cycleTimeInMs()
      Returns the value of the cycleTimeInMs record component.
      Specified by:
      cycleTimeInMs in interface Animation
      Returns:
      the value of the cycleTimeInMs record component