The model is now working and downwards compatible
This commit is contained in:
parent
b36d7d487f
commit
14d88f38bf
|
@ -21,7 +21,6 @@ public class ArcMover implements PolyMover {
|
||||||
this.middle = middle;
|
this.middle = middle;
|
||||||
this.p2 = p2;
|
this.p2 = p2;
|
||||||
init();
|
init();
|
||||||
System.out.println("r: " + r + " xm: " + xm + " ym: " + ym);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
|
@ -99,4 +98,9 @@ public class ArcMover implements PolyMover {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GameObject getLastItem() {
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,4 +41,15 @@ public class LineMover implements PolyMover {
|
||||||
return objects;
|
return objects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GameObject getLastItem() {
|
||||||
|
int i = objects.length - 1;
|
||||||
|
while (i > 0) {
|
||||||
|
if (objects[i] != null) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
return objects[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,6 @@ public interface PolyMover {
|
||||||
double[] getPointAt(int time);
|
double[] getPointAt(int time);
|
||||||
|
|
||||||
GameObject[] getItems();
|
GameObject[] getItems();
|
||||||
|
|
||||||
|
GameObject getLastItem();
|
||||||
}
|
}
|
|
@ -16,8 +16,7 @@ public class ArcFactory extends PolyMoverFactory {
|
||||||
private static final int PREFFERED_BUFFER_SIZE = 3;
|
private static final int PREFFERED_BUFFER_SIZE = 3;
|
||||||
|
|
||||||
public void init(GameObject[] objects, int count) {
|
public void init(GameObject[] objects, int count) {
|
||||||
System.out.println("count: " + count);
|
if (count < 3 || (!ArcMover.canCricleExistBetweenItems(objects[0], objects[1], objects[2])))
|
||||||
if (count < 3 || !ArcMover.canCricleExistBetweenItems(objects[0], objects[1], objects[2]))
|
|
||||||
addMover(new LineMover(objects, 3));
|
addMover(new LineMover(objects, 3));
|
||||||
else
|
else
|
||||||
addMover(new ArcMover(objects[0], objects[1], objects[2]));
|
addMover(new ArcMover(objects[0], objects[1], objects[2]));
|
||||||
|
@ -30,7 +29,7 @@ public class ArcFactory extends PolyMoverFactory {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinBufferSize() {
|
public int getMinBufferSize() {
|
||||||
return ArcMover.ITEMS_NEEDED;
|
return LineMover.ITEMS_NEEDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,7 +4,9 @@ import awlex.ospu.polymover.LineMover;
|
||||||
import awlex.ospu.polymover.PolyMover;
|
import awlex.ospu.polymover.PolyMover;
|
||||||
import itdelatrisu.opsu.objects.DummyObject;
|
import itdelatrisu.opsu.objects.DummyObject;
|
||||||
import itdelatrisu.opsu.objects.GameObject;
|
import itdelatrisu.opsu.objects.GameObject;
|
||||||
|
import yugecin.opsudance.Dancer;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -28,8 +30,7 @@ public abstract class PolyMoverFactory {
|
||||||
double[] ret = new double[2];
|
double[] ret = new double[2];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < movers.size()) {
|
while (i < movers.size()) {
|
||||||
GameObject[] items = movers.get(i).getItems();
|
if (movers.get(i).getLastItem().getEndTime() < time)
|
||||||
if (items[items.length - 1].getEndTime() < time)
|
|
||||||
break;
|
break;
|
||||||
double[] point = movers.get(i).getPointAt(time);
|
double[] point = movers.get(i).getPointAt(time);
|
||||||
ret[0] += point[0];
|
ret[0] += point[0];
|
||||||
|
@ -47,17 +48,16 @@ public abstract class PolyMoverFactory {
|
||||||
}
|
}
|
||||||
GameObject[] items = new GameObject[getMaxBufferSize()];
|
GameObject[] items = new GameObject[getMaxBufferSize()];
|
||||||
int i = 1;
|
int i = 1;
|
||||||
items[0] = startIndex == -1 ? new DummyObject() : objects[startIndex];
|
items[0] = startIndex == -1 ? Dancer.d : objects[startIndex];
|
||||||
while (i < items.length - 2) {
|
while (i < items.length - 1) {
|
||||||
GameObject g = objects[startIndex + i];
|
GameObject g = objects[startIndex + i];
|
||||||
if (g.isSlider() || g.isSpinner())
|
if (g.isSlider() || g.isSpinner())
|
||||||
break;
|
break;
|
||||||
items[i++] = g;
|
items[i++] = g;
|
||||||
}
|
}
|
||||||
items[i] = objects[startIndex + i];
|
items[i] = objects[startIndex + i];
|
||||||
i++;
|
|
||||||
latestIndex = startIndex + getMaxBufferSize() + i - items.length;
|
latestIndex = startIndex + getMaxBufferSize() + i - items.length;
|
||||||
if (i >= getMinBufferSize()) {
|
if (++i >= getMinBufferSize()) {
|
||||||
init(items, i);
|
init(items, i);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -250,6 +250,7 @@ public class Dancer {
|
||||||
c.start.set((float) spinnerStartPoint[0], (float) spinnerStartPoint[1]);
|
c.start.set((float) spinnerStartPoint[0], (float) spinnerStartPoint[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isCurrentLazySlider = false;
|
isCurrentLazySlider = false;
|
||||||
// detect lazy sliders, should work pretty good
|
// detect lazy sliders, should work pretty good
|
||||||
if (c.isSlider() && LAZY_SLIDERS && Utils.distance(c.start.x, c.start.y, c.end.x, c.end.y) <= Circle.diameter * 0.8f) {
|
if (c.isSlider() && LAZY_SLIDERS && Utils.distance(c.start.x, c.start.y, c.end.x, c.end.y) <= Circle.diameter * 0.8f) {
|
||||||
|
@ -275,7 +276,6 @@ public class Dancer {
|
||||||
polyMoverFactory.create(gameObjects, objectIndex - 1);
|
polyMoverFactory.create(gameObjects, objectIndex - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time < c.getTime()) {
|
if (time < c.getTime()) {
|
||||||
if (!(p.isSpinner() || c.isSpinner())) {
|
if (!(p.isSpinner() || c.isSpinner())) {
|
||||||
double[] point = polyMoverFactory.getPointAt(time);
|
double[] point = polyMoverFactory.getPointAt(time);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user