Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
use inner interface instead of default impl so we can go back to java…
Browse files Browse the repository at this point in the history
… 7 :) (close #87)
  • Loading branch information
yugecin committed Dec 4, 2016
1 parent 9e63086 commit 7e82b05
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 1 addition & 6 deletions src/awlex/ospu/polymover/factory/PolyMoverFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* 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;
Expand Down Expand Up @@ -47,11 +47,6 @@ 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();
Expand Down
2 changes: 1 addition & 1 deletion src/yugecin/opsudance/Dancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void setMoverFactoryIndex(int moverFactoryIndex) {
}
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();
}
Expand Down
4 changes: 2 additions & 2 deletions src/yugecin/opsudance/movers/factories/MoverFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public interface MoverFactory {

Mover create(GameObject start, GameObject end, int dir);

default boolean isMultiPoint() {
return false;
interface MultiPoint {

}

}

0 comments on commit 7e82b05

Please sign in to comment.