Avancement sur l'implémentation des méthodes des interfaces. Penser à

continuer l'idée du neighbourList
This commit is contained in:
antograb committed 2017-11-16 09:58:44 +01:00
1 parent f7646c48f6
commit 36dd8ff805
3 files changed
+17 -7

No files matched your search

+5
View File
@@ -1,3 +1,4 @@
import java.util.List;
public abstract class Box
implements VertexInterface {
@@ -6,12 +7,16 @@ public abstract class Box
private int y ;
private String label ;
private Maze maze ;
private List<Box> neighbourList ;
public Box (String label, int x, int y, Maze maze) {
this.label = label ;
this.x = x ;
this.y = y ;
this.maze = maze ;
if (x != 0 && y != 0 && x != maze.getDimensionX() && y != maze.getDimensionY()) {
this.neighbourList.add(maze.getMaze()[x+1][y]) ;
}
}
public boolean compareTo(VertexInterface vertex) {