Fix List to ArrayList
Add toString method for Box Add code to print the shortest path for this particular case.
This commit is contained in:
1 parent
fda73a2025
commit
d46b3c3b99
8 files changed
+19
-21
No files matched your search
+4
-4
@@ -21,7 +21,7 @@ public abstract class Box
|
||||
|
||||
}
|
||||
|
||||
public List<VertexInterface> generateNeighbors() {
|
||||
public ArrayList<VertexInterface> generateNeighbors() {
|
||||
return maze.generateNeighbours(this) ;
|
||||
|
||||
}
|
||||
@@ -45,11 +45,11 @@ public abstract class Box
|
||||
return false ;
|
||||
}
|
||||
|
||||
public List<Box> getNeighbourList() {
|
||||
public ArrayList<Box> getNeighbourList() {
|
||||
return neighbourList;
|
||||
}
|
||||
|
||||
public void setNeighbourList(List<Box> neighbourList) {
|
||||
public void setNeighbourList(ArrayList<Box> neighbourList) {
|
||||
this.neighbourList = neighbourList;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public abstract class Box
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return label;
|
||||
return "Label: " + label + ", x: " + x + ", y: " + y;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user