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
ConstructorDescriptionLoopingAnimation
(int rowStart, int columnStart, int rowEnd, int columnEnd) Create a new instance ofLinkedAnimation
LoopingAnimation
(int rowStart, int columnStart, int rowEnd, int columnEnd, long cycleTimeInMs) Creates an instance of aLoopingAnimation
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the value of thecolumnEnd
record component.int
Returns the value of thecolumnStart
record component.long
Returns the value of thecycleTimeInMs
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
loop()
A value that states whether thisAnimation
should loop after it has finished.int
rowEnd()
Returns the value of therowEnd
record component.int
rowStart()
Returns the value of therowStart
record component.final String
toString()
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 aLoopingAnimation
record class.- Parameters:
rowStart
- the value for therowStart
record componentcolumnStart
- the value for thecolumnStart
record componentrowEnd
- the value for therowEnd
record componentcolumnEnd
- the value for thecolumnEnd
record componentcycleTimeInMs
- the value for thecycleTimeInMs
record component
-
-
Method Details
-
loop
public boolean loop()Description copied from interface:Animation
A value that states whether thisAnimation
should loop after it has finished. Only aLoopingAnimation
will returntrue
for 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 therowStart
record component. -
columnStart
public int columnStart()Returns the value of thecolumnStart
record component.- Specified by:
columnStart
in interfaceAnimation
- Returns:
- the value of the
columnStart
record component
-
rowEnd
public int rowEnd()Returns the value of therowEnd
record component. -
columnEnd
public int columnEnd()Returns the value of thecolumnEnd
record component. -
cycleTimeInMs
public long cycleTimeInMs()Returns the value of thecycleTimeInMs
record component.- Specified by:
cycleTimeInMs
in interfaceAnimation
- Returns:
- the value of the
cycleTimeInMs
record component
-