java.lang.Object
java.lang.Record
com.github.hanyaeger.api.entities.LoopingAnimation
- All Implemented Interfaces:
Animation
-
Field Summary
Fields inherited from interface com.github.hanyaeger.api.entities.Animation
DEFAULT_AUTOCYCLE_INTERVAL -
Constructor Summary
ConstructorsConstructorDescriptionLoopingAnimation(int rowStart, int columnStart, int rowEnd, int columnEnd) Create a new instance ofLinkedAnimationLoopingAnimation(int rowStart, int columnStart, int rowEnd, int columnEnd, long cycleTimeInMs) Creates an instance of aLoopingAnimationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecolumnEndrecord component.intReturns the value of thecolumnStartrecord component.longReturns the value of thecycleTimeInMsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanloop()A value that states whether thisAnimationshould loop after it has finished.introwEnd()Returns the value of therowEndrecord component.introwStart()Returns the value of therowStartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LoopingAnimation
public LoopingAnimation(int rowStart, int columnStart, int rowEnd, int columnEnd) Create a new instance ofLinkedAnimation- Parameters:
rowStart- the 0-based row-index of the first sprite to be showncolumnStart- the 0-based column-index of the first sprite to be shownrowEnd- the 0-based row-index of the last sprite to be showncolumnEnd- 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 aLoopingAnimationrecord class.- Parameters:
rowStart- the value for therowStartrecord componentcolumnStart- the value for thecolumnStartrecord componentrowEnd- the value for therowEndrecord componentcolumnEnd- the value for thecolumnEndrecord componentcycleTimeInMs- the value for thecycleTimeInMsrecord component
-
-
Method Details
-
loop
public boolean loop()Description copied from interface:AnimationA value that states whether thisAnimationshould loop after it has finished. Only aLoopingAnimationwill returntruefor this value. -
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. -
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. -
equals
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 '=='. -
rowStart
public int rowStart()Returns the value of therowStartrecord component. -
columnStart
public int columnStart()Returns the value of thecolumnStartrecord component.- Specified by:
columnStartin interfaceAnimation- Returns:
- the value of the
columnStartrecord component
-
rowEnd
public int rowEnd()Returns the value of therowEndrecord component. -
columnEnd
public int columnEnd()Returns the value of thecolumnEndrecord component. -
cycleTimeInMs
public long cycleTimeInMs()Returns the value of thecycleTimeInMsrecord component.- Specified by:
cycleTimeInMsin interfaceAnimation- Returns:
- the value of the
cycleTimeInMsrecord component
-