diff --git a/ABox.java b/ABox.java index be124df..a2eb942 100644 --- a/ABox.java +++ b/ABox.java @@ -1,9 +1,9 @@ public class ABox extends Box{ - public ABox (int x, int y) { + public ABox (String label, int x, int y, Maze maze) { - super(x,y) ; + super(label,x,y,maze) ; } } diff --git a/Box.java b/Box.java index 9221978..9f8c8e7 100644 --- a/Box.java +++ b/Box.java @@ -1,14 +1,24 @@ -public abstract class Box { +public abstract class Box + implements VertexInterface { private int x ; private int y ; + private String label ; + private Maze maze ; - public Box (int x, int y) { - + public Box (String label, int x, int y, Maze maze) { + this.label = label ; this.x = x ; this.y = y ; - + this.maze = maze ; + } + + public boolean compareTo(VertexInterface vertex) { + if (this.getLabel() == vertex.getLabel()) { + return true ; + } + return false ; } public int getX() { @@ -26,5 +36,23 @@ public abstract class Box { 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; + } + + } diff --git a/DBox.java b/DBox.java index 9e13a16..8772532 100644 --- a/DBox.java +++ b/DBox.java @@ -1,9 +1,9 @@ public class DBox extends Box{ - public DBox (int x, int y) { + public DBox (String label, int x, int y, Maze maze) { - super(x,y) ; + super(label,x,y,maze) ; } diff --git a/EBox.java b/EBox.java index 9a410b2..84b2bf2 100644 --- a/EBox.java +++ b/EBox.java @@ -1,9 +1,9 @@ public class EBox extends Box{ - public EBox (int x, int y) { + public EBox (String label, int x, int y, Maze maze) { - super(x,y) ; + super(label,x,y,maze) ; } diff --git a/GraphInterface.java b/GraphInterface.java new file mode 100644 index 0000000..0841a8d --- /dev/null +++ b/GraphInterface.java @@ -0,0 +1,14 @@ +import java.util.ArrayList; + +public interface GraphInterface { + + /** Returns the number of Vertexes */ + public int getVertexNumber() ; + + /** Return the cost between two vertexes */ + public int getCost(VertexInterface start, VertexInterface end) ; + + /** Returns an list of Vertexes */ + public ArrayList getVertexes() ; + +} diff --git a/Maze.java b/Maze.java index 4a15ce4..cfdb980 100644 --- a/Maze.java +++ b/Maze.java @@ -1,15 +1,22 @@ -public class Maze { +public class Maze + implements GraphInterface{ int dimensionX ; int dimensionY ; int[][] maze ; + int[][] adjMatrix ; - public Maze(int x, int y) { + public Maze(int dimensionX, int dimensionY, int[][] adjmatrix) { - this.dimensionX = x ; - this.dimensionY = y ; + this.dimensionX = dimensionX ; + this.dimensionY = dimensionY ; this.maze = new int[dimensionX][dimensionY] ; + this.adjMatrix = adjMatrix ; + + } + + public int getCost(VertexInterface start, VertexInterface end) { } @@ -39,4 +46,5 @@ public class Maze { + } diff --git a/VertexInterface.java b/VertexInterface.java new file mode 100644 index 0000000..c78bd3f --- /dev/null +++ b/VertexInterface.java @@ -0,0 +1,9 @@ + +public interface VertexInterface { + + /** Compare a Vertex to another */ + public boolean compareTo(VertexInterface vertex) ; + + public String getLabel() ; + +} diff --git a/WBox.java b/WBox.java index 7705426..69bb845 100644 --- a/WBox.java +++ b/WBox.java @@ -1,9 +1,9 @@ public class WBox extends Box { - public WBox (int x, int y) { + public WBox (String label, int x, int y, Maze maze) { - super(x,y) ; + super(label,x,y,maze) ; }