Merge branch 'fixUnneededCode' into lastDijsktraClasses

This commit was merged in pull request #5.
This commit is contained in:
regar42 committed 2017-12-10 17:48:34 +01:00
commit b59a8436dd
10 files changed
+41 -98

No files matched your search

+4 -36
View File
@@ -1,6 +1,5 @@
package maze;
import java.util.ArrayList;
import java.util.List;
import dijkstra.VertexInterface;
@@ -23,7 +22,7 @@ public abstract class Box
private int y ;
private String label = null ;
private Maze maze ;
private List<Box> neighbourList = new ArrayList<Box>() ;
private ArrayList<Box> neighbourList = new ArrayList<Box>() ;
public Box (String label, int x, int y, Maze maze) {
@@ -34,18 +33,11 @@ public abstract class Box
}
public List<VertexInterface> generateNeighbors() {
public ArrayList<VertexInterface> generateNeighbors() {
return maze.generateNeighbours(this) ;
}
public boolean compareTo(VertexInterface vertex) {
if (this.getLabel() == vertex.getLabel()) {
return true ;
}
return false ;
}
public boolean isWalkable() {
return true ;
}
@@ -58,48 +50,24 @@ public abstract class Box
return false ;
}
public List<Box> getNeighbourList() {
public ArrayList<Box> getNeighbourList() {
return neighbourList;
}
public void setNeighbourList(List<Box> neighbourList) {
this.neighbourList = neighbourList;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public Maze getMaze() {
return maze;
}
public void setMaze(Maze maze) {
this.maze = maze;
}
public String toString() {
return label;
return "Label: " + label + ", x: " + x + ", y: " + y;
}
}