Merge branch 'javadoc' into lastDijsktraClasses
This commit was merged in pull request #6.
This commit is contained in:
commit
5d75a82103
15 files changed
+158
-20
No files matched your search
@@ -1,5 +1,8 @@
|
||||
package maze;
|
||||
|
||||
/**
|
||||
* <code>ABox</code> is an arrival <code>Box</code>. It's the last <code>Box</code> to be walked through and it's an exit to the <code>Maze</code>.
|
||||
*/
|
||||
public class ABox extends Box{
|
||||
|
||||
public ABox (String label, int x, int y, Maze maze) {
|
||||
|
||||
@@ -4,6 +4,18 @@ import java.util.List;
|
||||
|
||||
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
|
||||
implements VertexInterface {
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package maze;
|
||||
|
||||
/**
|
||||
* A <code>DBox</code> is the <code>Box</code> on which the user is first in the <code>Maze</code>.
|
||||
*/
|
||||
|
||||
public class DBox extends Box{
|
||||
|
||||
public DBox (String label, int x, int y, Maze maze) {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package maze;
|
||||
|
||||
/**
|
||||
* An <code>EBox</code> is a <code>Box</code> that can be walked through (an empty box).
|
||||
*/
|
||||
|
||||
public class EBox extends Box{
|
||||
|
||||
|
||||
|
||||
+17
-1
@@ -8,6 +8,14 @@ import java.util.ArrayList;
|
||||
import dijkstra.GraphInterface;
|
||||
import dijkstra.VertexInterface;
|
||||
|
||||
/** <h1> Maze class </h1>
|
||||
* <p>
|
||||
* This class describes the maze as a matrix of Boxes ({@link maze.Box}).
|
||||
*
|
||||
* @author Antonin Godard
|
||||
* @author Sylvain Rager
|
||||
*
|
||||
*/
|
||||
public class Maze
|
||||
implements GraphInterface {
|
||||
|
||||
@@ -21,6 +29,9 @@ public class Maze
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public int getCost(VertexInterface start, VertexInterface end) {
|
||||
|
||||
Box startBox = (Box) start ;
|
||||
@@ -81,12 +92,17 @@ public class Maze
|
||||
|
||||
}
|
||||
|
||||
/**Constructs the maze from a text file, according to each single character on each line.
|
||||
* @param filename
|
||||
* The path to the file containing the representation of the maze.
|
||||
*/
|
||||
|
||||
public final void initFromTextFile(String filename) {
|
||||
|
||||
FileReader fr = null ;
|
||||
BufferedReader br = null ;
|
||||
|
||||
try { //Determines the height of the maze and stores it into lineCount
|
||||
try {
|
||||
fr = new FileReader(filename) ;
|
||||
br = new BufferedReader(fr) ;
|
||||
while (br.readLine() != null) dimensionY++;
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
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
|
||||
extends Exception {
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package maze;
|
||||
|
||||
/**
|
||||
* A <code>WBox</code> is a <code>Box</code> that can't be walked through (a wall).
|
||||
*/
|
||||
|
||||
public class WBox extends Box {
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user