Remodeled PolyMoverFactories and Movers, to be more effizient and userfriendly

This commit is contained in:
Awlex
2016-11-20 04:42:46 +01:00
parent 5a5c13f64c
commit b36d7d487f
9 changed files with 203 additions and 120 deletions

View File

@@ -19,8 +19,8 @@ package yugecin.opsudance;
import awlex.ospu.movers.factories.CenterSpiralMoverFactory;
import awlex.ospu.movers.factories.SpiralMoverFactory;
import awlex.ospu.polymover.PolyMover;
import awlex.ospu.polymover.factory.ArcFactory;
import awlex.ospu.polymover.factory.LinearFactory;
import awlex.ospu.polymover.factory.PolyMoverFactory;
import awlex.ospu.spinners.SpiralSpinner;
import itdelatrisu.opsu.Options;
@@ -74,6 +74,7 @@ public class Dancer {
};
public static PolyMoverFactory[] polyMoverFactories = new PolyMoverFactory[]{
new LinearFactory(),
new ArcFactory()
};
@@ -267,13 +268,11 @@ public class Dancer {
c.start = new Vec2f((float) spinnerStartPoint[0], (float) spinnerStartPoint[1]);
}
if (polyMoverFactory.getLatestIndex() < objectIndex + polyMoverFactory.getPrefferedBufferSize() - 1) {
if (polyMoverFactory.isInitialized()) {
polyMoverFactory.update(gameObjects[objectIndex + polyMoverFactory.getPrefferedBufferSize()]);
}
else {
polyMoverFactory.init(gameObjects, objectIndex - 1);
}
if (polyMoverFactory.isInitialized() && polyMoverFactory.getLatestIndex() < objectIndex + polyMoverFactory.getLatestIndex() - 1) {
polyMoverFactory.update(gameObjects[objectIndex + polyMoverFactory.getMaxBufferSize() - 1]);
}
else {
polyMoverFactory.create(gameObjects, objectIndex - 1);
}
}