merge the movers into one list, use java8 for default impl in interfaces

This commit is contained in:
yugecin
2016-11-20 17:24:58 +01:00
parent b325b53e4f
commit cdd88d9a8d
7 changed files with 38 additions and 56 deletions

View File

@@ -2,18 +2,18 @@ package awlex.ospu.polymover.factory;
import awlex.ospu.polymover.LineMover;
import awlex.ospu.polymover.PolyMover;
import itdelatrisu.opsu.objects.DummyObject;
import itdelatrisu.opsu.objects.GameObject;
import yugecin.opsudance.Dancer;
import yugecin.opsudance.movers.Mover;
import yugecin.opsudance.movers.factories.MoverFactory;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* Created by Awlex on 18.11.2016.
*/
public abstract class PolyMoverFactory {
public abstract class PolyMoverFactory implements MoverFactory {
private LinkedList<PolyMover> movers;
private int latestIndex;
@@ -42,6 +42,16 @@ public abstract class PolyMoverFactory {
return ret;
}
@Override
public Mover create(GameObject start, GameObject end, int dir) {
throw new UnsupportedOperationException("Polymovers should use the create variant with all the gameobjects + startindex");
}
@Override
public boolean isMultiPoint() {
return true;
}
public final void create(GameObject[] objects, int startIndex) {
if (latestIndex <= startIndex) {
movers.clear();