Added some documentation for classes and methods of modified files.
This commit is contained in:
1 parent
9d34134943
commit
8a8eac7ac1
3 files changed
+28
-1
No files matched your search
@@ -4,6 +4,18 @@ import java.util.List;
|
|||||||
|
|
||||||
import dijkstra.VertexInterface;
|
import dijkstra.VertexInterface;
|
||||||
|
|
||||||
|
/** <h1> Box class </h1>
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* This class describes a Box and implements {@link dijkstra.VertexInterface}.
|
||||||
|
* <p>
|
||||||
|
* A Box is represented with its coordinates, its label, and its neighbourList. It also has a reference on the Maze.
|
||||||
|
*
|
||||||
|
* @author Antonin Godard
|
||||||
|
* @author Sylvain Rager
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
public abstract class Box
|
public abstract class Box
|
||||||
implements VertexInterface {
|
implements VertexInterface {
|
||||||
|
|
||||||
|
|||||||
+9
-1
@@ -12,7 +12,6 @@ import dijkstra.VertexInterface;
|
|||||||
* <p>
|
* <p>
|
||||||
* This class describes the maze as a matrix of Boxes ({@link maze.Box}).
|
* This class describes the maze as a matrix of Boxes ({@link maze.Box}).
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @author Antonin Godard
|
* @author Antonin Godard
|
||||||
* @author Sylvain Rager
|
* @author Sylvain Rager
|
||||||
*
|
*
|
||||||
@@ -30,6 +29,9 @@ public class Maze
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public int getCost(VertexInterface start, VertexInterface end) {
|
public int getCost(VertexInterface start, VertexInterface end) {
|
||||||
|
|
||||||
Box startBox = (Box) start ;
|
Box startBox = (Box) start ;
|
||||||
@@ -51,6 +53,9 @@ public class Maze
|
|||||||
return dimensionX*dimensionY ;
|
return dimensionX*dimensionY ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ArrayList<VertexInterface>
|
||||||
|
*/
|
||||||
public ArrayList<VertexInterface> getVertexes() {
|
public ArrayList<VertexInterface> getVertexes() {
|
||||||
ArrayList<VertexInterface> vertexList = new ArrayList<VertexInterface>() ;
|
ArrayList<VertexInterface> vertexList = new ArrayList<VertexInterface>() ;
|
||||||
for (int i = 0 ; i < dimensionX ; i++) {
|
for (int i = 0 ; i < dimensionX ; i++) {
|
||||||
@@ -63,6 +68,9 @@ public class Maze
|
|||||||
return vertexList ;
|
return vertexList ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public ArrayList<VertexInterface> generateNeighbours(VertexInterface vertex) {
|
public ArrayList<VertexInterface> generateNeighbours(VertexInterface vertex) {
|
||||||
|
|
||||||
Box box = (Box)vertex ;
|
Box box = (Box)vertex ;
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
package maze;
|
package maze;
|
||||||
|
|
||||||
|
/**<h1> MazeReadingException exception </h1>
|
||||||
|
* <p>
|
||||||
|
* This class is used to throw exception when reading and initiating the maze from a text file.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
public class MazeReadingException
|
public class MazeReadingException
|
||||||
extends Exception {
|
extends Exception {
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user