opsu-dance/src/awlex/ospu/polymover/LineMover.java

33 lines
783 B
Java
Raw Normal View History

2016-11-19 15:41:53 +01:00
package awlex.ospu.polymover;
import itdelatrisu.opsu.objects.DummyObject;
import itdelatrisu.opsu.objects.GameObject;
import yugecin.opsudance.movers.LinearMover;
/**
* Created by Awlex on 19.11.2016.
*/
public class LineMover extends PolyMover {
GameObject[] objects;
public LineMover(GameObject[] objects, int startIndex, int count) {
this.objects = new GameObject[count];
System.arraycopy(objects, startIndex, this.objects, 0, count);
}
@Override
public double[] getPointAt(int time) {
int i = 0;
while (time > objects[i].getTime() && i < objects.length - 1)
i++;
return new LinearMover(i == 0 ? new DummyObject() : objects[i - 1], objects[i], 1).getPointAt(time);
}
@Override
public GameObject[] getItems() {
return new GameObject[0];
}
}