We cannot use transformAndConcat in this Guava version
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package com.replaymod.pathing.player;
|
package com.replaymod.pathing.player;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.FluentIterable;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Ordering;
|
import com.google.common.collect.Ordering;
|
||||||
import com.google.common.primitives.Longs;
|
import com.google.common.primitives.Longs;
|
||||||
import com.google.common.util.concurrent.ListenableFuture;
|
import com.google.common.util.concurrent.ListenableFuture;
|
||||||
@@ -34,15 +34,15 @@ public abstract class AbstractTimelinePlayer {
|
|||||||
public ListenableFuture<Void> start(Timeline timeline) {
|
public ListenableFuture<Void> start(Timeline timeline) {
|
||||||
this.timeline = timeline;
|
this.timeline = timeline;
|
||||||
|
|
||||||
Iterator<Keyframe> iter = FluentIterable.from(timeline.getPaths())
|
Iterator<Keyframe> iter = Iterables.concat(Iterables.transform(timeline.getPaths(),
|
||||||
.transformAndConcat(new Function<Path, Iterable<Keyframe>>() {
|
new Function<Path, Iterable<Keyframe>>() {
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Iterable<Keyframe> apply(@Nullable Path input) {
|
public Iterable<Keyframe> apply(@Nullable Path input) {
|
||||||
assert input != null;
|
assert input != null;
|
||||||
return input.getKeyframes();
|
return input.getKeyframes();
|
||||||
}
|
}
|
||||||
}).iterator();
|
})).iterator();
|
||||||
if (!iter.hasNext()) {
|
if (!iter.hasNext()) {
|
||||||
lastTimestamp = 0;
|
lastTimestamp = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.replaymod.simplepathing.gui;
|
package com.replaymod.simplepathing.gui;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import com.google.common.collect.FluentIterable;
|
import com.google.common.collect.Iterables;
|
||||||
import com.replaymod.core.ReplayMod;
|
import com.replaymod.core.ReplayMod;
|
||||||
import com.replaymod.pathing.path.Keyframe;
|
import com.replaymod.pathing.path.Keyframe;
|
||||||
import com.replaymod.pathing.path.Path;
|
import com.replaymod.pathing.path.Path;
|
||||||
@@ -37,14 +37,14 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
|
|||||||
|
|
||||||
renderer.bindTexture(ReplayMod.TEXTURE);
|
renderer.bindTexture(ReplayMod.TEXTURE);
|
||||||
|
|
||||||
for (Keyframe keyframe : FluentIterable.from(mod.getCurrentTimeline().getPaths()).transformAndConcat(new Function<Path, Iterable<Keyframe>>() {
|
for (Keyframe keyframe : Iterables.concat(Iterables.transform(mod.getCurrentTimeline().getPaths(), new Function<Path, Iterable<Keyframe>>() {
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public Iterable<Keyframe> apply(@Nullable Path input) {
|
public Iterable<Keyframe> apply(@Nullable Path input) {
|
||||||
assert input != null;
|
assert input != null;
|
||||||
return input.getKeyframes();
|
return input.getKeyframes();
|
||||||
}
|
}
|
||||||
})) {
|
}))) {
|
||||||
if (keyframe.getTime() >= startTime && keyframe.getTime() <= endTime) {
|
if (keyframe.getTime() >= startTime && keyframe.getTime() <= endTime) {
|
||||||
double relativeTime = keyframe.getTime() - startTime;
|
double relativeTime = keyframe.getTime() - startTime;
|
||||||
int positonX = BORDER_LEFT + (int) (relativeTime / visibleTime * visibleWidth) - KEYFRAME_SIZE / 2;
|
int positonX = BORDER_LEFT + (int) (relativeTime / visibleTime * visibleWidth) - KEYFRAME_SIZE / 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user