We cannot use transformAndConcat in this Guava version

This commit is contained in:
johni0702
2016-03-11 13:04:57 +01:00
parent 65d8c2e98b
commit c123363a9f
2 changed files with 7 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
package com.replaymod.pathing.player;
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.primitives.Longs;
import com.google.common.util.concurrent.ListenableFuture;
@@ -34,15 +34,15 @@ public abstract class AbstractTimelinePlayer {
public ListenableFuture<Void> start(Timeline timeline) {
this.timeline = timeline;
Iterator<Keyframe> iter = FluentIterable.from(timeline.getPaths())
.transformAndConcat(new Function<Path, Iterable<Keyframe>>() {
Iterator<Keyframe> iter = Iterables.concat(Iterables.transform(timeline.getPaths(),
new Function<Path, Iterable<Keyframe>>() {
@Nullable
@Override
public Iterable<Keyframe> apply(@Nullable Path input) {
assert input != null;
return input.getKeyframes();
}
}).iterator();
})).iterator();
if (!iter.hasNext()) {
lastTimestamp = 0;
} else {

View File

@@ -1,7 +1,7 @@
package com.replaymod.simplepathing.gui;
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.pathing.path.Keyframe;
import com.replaymod.pathing.path.Path;
@@ -37,14 +37,14 @@ public class GuiKeyframeTimeline extends AbstractGuiTimeline<GuiKeyframeTimeline
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
@Override
public Iterable<Keyframe> apply(@Nullable Path input) {
assert input != null;
return input.getKeyframes();
}
})) {
}))) {
if (keyframe.getTime() >= startTime && keyframe.getTime() <= endTime) {
double relativeTime = keyframe.getTime() - startTime;
int positonX = BORDER_LEFT + (int) (relativeTime / visibleTime * visibleWidth) - KEYFRAME_SIZE / 2;