Skip to content

Commit

Permalink
Added AnimationState setNext and clearNext.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed May 5, 2020
1 parent 742d11f commit 94e6e41
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -522,6 +522,11 @@ public void clearTrack (int trackIndex) {
queue.drain();
}

/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */
public void clearNext (TrackEntry entry) {
disposeNext(entry.next);
}

private void setCurrent (int index, TrackEntry current, boolean interrupt) {
TrackEntry from = expandToIndex(index);
tracks.set(index, current);
Expand Down Expand Up @@ -1084,11 +1089,17 @@ public void setDrawOrderThreshold (float drawOrderThreshold) {
this.drawOrderThreshold = drawOrderThreshold;
}

/** The animation queued to start after this animation, or null. <code>next</code> makes up a linked list. */
/** The animation queued to start after this animation, or null if there is none. <code>next</code> makes up a linked list.
* It cannot be set to null, use {@link AnimationState#clearNext(TrackEntry)} instead. */
public @Null TrackEntry getNext () {
return next;
}

public void setNext (TrackEntry next) {
if (next == null) throw new IllegalArgumentException("next cannot be null.");
this.next = next;
}

/** Returns true if at least one loop has been completed.
* <p>
* See {@link AnimationStateListener#complete(TrackEntry)}. */
Expand Down

0 comments on commit 94e6e41

Please sign in to comment.