Package kr.toxicity.model.api.animation
Record Class AnimationKeyframe
java.lang.Object
java.lang.Record
kr.toxicity.model.api.animation.AnimationKeyframe
- Record Components:
progresses- the array of animation progresses
- All Implemented Interfaces:
TimedStorage<AnimationProgress>
public record AnimationKeyframe(@NotNull AnimationProgress[] progresses)
extends Record
implements TimedStorage<AnimationProgress>
Represents a collection of animation keyframes, optimized for efficient storage and access.
This record stores an array of AnimationProgress objects, which define the state of a bone
at specific time intervals. It implements TimedStorage for indexed access.
- Since:
- 2.0.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface kr.toxicity.model.api.animation.TimedStorage
TimedStorage.ListDelegate<T extends Timed> -
Constructor Summary
ConstructorsConstructorDescriptionAnimationKeyframe(@NotNull AnimationProgress[] progresses) Creates an instance of aAnimationKeyframerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull AnimationKeyframe.Builderbuilder(int size, boolean rotateGlobal) Creates a new builder for constructing an AnimationKeyframe.final booleanIndicates whether some other object is "equal to" this one.@NotNull AnimationProgressget(int i) Retrieves the element at the specified index.@NotNull AnimationProgressgetLast()Retrieves the last element in the storage.final inthashCode()Returns a hash code value for this object.@NotNull AnimationProgress[]Returns the value of theprogressesrecord component.intsize()Returns the number of elements in the storage.@NotNull TimedStorage<AnimationProgress> toEmpty()Converts this keyframe collection to a storage of empty progresses.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AnimationKeyframe
Creates an instance of aAnimationKeyframerecord class.- Parameters:
progresses- the value for theprogressesrecord component
-
-
Method Details
-
builder
Creates a new builder for constructing an AnimationKeyframe.- Parameters:
size- the number of keyframesrotateGlobal- whether rotation should be applied globally- Returns:
- a new builder instance
- Since:
- 2.0.0
-
get
Description copied from interface:TimedStorageRetrieves the element at the specified index.- Specified by:
getin interfaceTimedStorage<AnimationProgress>- Parameters:
i- the index of the element- Returns:
- the element
-
getLast
Description copied from interface:TimedStorageRetrieves the last element in the storage.- Specified by:
getLastin interfaceTimedStorage<AnimationProgress>- Returns:
- the last element
-
size
public int size()Description copied from interface:TimedStorageReturns the number of elements in the storage.- Specified by:
sizein interfaceTimedStorage<AnimationProgress>- Returns:
- the size
-
toEmpty
Converts this keyframe collection to a storage of empty progresses.- Returns:
- a new timed storage with empty progresses
- Since:
- 2.0.0
-
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 withObjects::equals(Object,Object). -
progresses
Returns the value of theprogressesrecord component.- Returns:
- the value of the
progressesrecord component
-