use inner interface instead of default impl so we can go back to java 7 :) (close #87)
This commit is contained in:
parent
9e63086600
commit
7e82b05a56
4
pom.xml
4
pom.xml
|
@ -36,8 +36,8 @@
|
|||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
/**
|
||||
* Created by Awlex on 18.11.2016.
|
||||
*/
|
||||
public abstract class PolyMoverFactory implements MoverFactory {
|
||||
public abstract class PolyMoverFactory implements MoverFactory, MoverFactory.MultiPoint {
|
||||
|
||||
private LinkedList<PolyMover> movers;
|
||||
private int latestIndex;
|
||||
|
@ -47,11 +47,6 @@ public abstract class PolyMoverFactory implements MoverFactory {
|
|||
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();
|
||||
|
|
|
@ -160,7 +160,7 @@ public class Dancer {
|
|||
}
|
||||
this.moverFactoryIndex = moverFactoryIndex;
|
||||
moverFactory = moverFactories[moverFactoryIndex];
|
||||
multipoint = moverFactory.isMultiPoint();
|
||||
multipoint = moverFactory instanceof MoverFactory.MultiPoint;
|
||||
// to prevent crashes when changing mover in storyboard, create mover now
|
||||
createNewMover();
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ public interface MoverFactory {
|
|||
|
||||
Mover create(GameObject start, GameObject end, int dir);
|
||||
|
||||
default boolean isMultiPoint() {
|
||||
return false;
|
||||
interface MultiPoint {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user