diff --git a/Box.java b/Box.java index 9f8c8e7..5f0bf16 100644 --- a/Box.java +++ b/Box.java @@ -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 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) { diff --git a/EBox.java b/EBox.java index 84b2bf2..6ac4434 100644 --- a/EBox.java +++ b/EBox.java @@ -5,6 +5,7 @@ public class EBox extends Box{ super(label,x,y,maze) ; + } } diff --git a/Maze.java b/Maze.java index cfdb980..915a472 100644 --- a/Maze.java +++ b/Maze.java @@ -1,3 +1,5 @@ +import java.util.Iterator; +import java.util.List; public class Maze implements GraphInterface{ @@ -5,18 +7,20 @@ public class Maze int dimensionX ; int dimensionY ; int[][] maze ; - int[][] adjMatrix ; - public Maze(int dimensionX, int dimensionY, int[][] adjmatrix) { + public Maze(int dimensionX, int dimensionY, int[][] maze) { - this.dimensionX = dimensionX ; - this.dimensionY = dimensionY ; - this.maze = new int[dimensionX][dimensionY] ; - this.adjMatrix = adjMatrix ; + this.maze = maze ; + this.dimensionX = maze.length ; + this.dimensionY = maze[0].length ; } - public int getCost(VertexInterface start, VertexInterface end) { + public int getCost(Box start, Box end) { + + } + + public int getVertexNumber() { }