make it work
This commit is contained in:
@@ -22,17 +22,16 @@ import itdelatrisu.opsu.objects.GameObject;
|
||||
public class DefaultSliderMoverController implements SliderMoverController {
|
||||
|
||||
@Override
|
||||
public GameObject process(GameObject obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameObject processNext(int time) {
|
||||
return null;
|
||||
public GameObject[] process(GameObject p, GameObject c, int time) {
|
||||
return new GameObject[] {
|
||||
p,
|
||||
c
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Nothing special, just follow it";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,18 +17,41 @@
|
||||
*/
|
||||
package yugecin.opsudance.movers.slidermovers;
|
||||
|
||||
import itdelatrisu.opsu.objects.Circle;
|
||||
import itdelatrisu.opsu.objects.GameObject;
|
||||
import itdelatrisu.opsu.objects.Slider;
|
||||
|
||||
public class InheritedSliderMoverController implements SliderMoverController {
|
||||
|
||||
@Override
|
||||
public GameObject process(GameObject obj) {
|
||||
return obj;
|
||||
}
|
||||
private GameObject currentSlider;
|
||||
private Circle[] positions;
|
||||
private int idx;
|
||||
|
||||
@Override
|
||||
public GameObject processNext(int time) {
|
||||
return null;
|
||||
public GameObject[] process(GameObject p, GameObject c, int time) {
|
||||
GameObject[] ret = new GameObject[2];
|
||||
if (!c.isSlider()) {
|
||||
ret[0] = p;
|
||||
ret[1] = c;
|
||||
return ret;
|
||||
}
|
||||
if (currentSlider != c) {
|
||||
currentSlider = c;
|
||||
positions = ((Slider) c).getTickPositionCircles();
|
||||
idx = 0;
|
||||
}
|
||||
for (; idx < positions.length; idx++) {
|
||||
if (time < positions[idx].getTime() || idx == positions.length - 1) {
|
||||
ret[1] = positions[idx];
|
||||
if (idx == 0) {
|
||||
ret[0] = p;
|
||||
} else {
|
||||
ret[0] = positions[idx - 1];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return null; // make the compiler happy c:
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,6 @@ import itdelatrisu.opsu.objects.GameObject;
|
||||
|
||||
public interface SliderMoverController {
|
||||
|
||||
GameObject process(GameObject obj);
|
||||
GameObject processNext(int time);
|
||||
GameObject[] process(GameObject p, GameObject c, int time);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user