Files
TpMazeJava/src/maze/Box.java
T
antograb d836c2c9f0 Remove unneeded setters in Box.java
Remove compareTo in Box.java and VertexInterface
2017-12-10 17:21:26 +01:00

62 lines
975 B
Java

package maze;
import java.util.ArrayList;
import dijkstra.VertexInterface;
public abstract class Box
implements VertexInterface {
private int x ;
private int y ;
private String label = null ;
private Maze maze ;
private ArrayList<Box> neighbourList = new ArrayList<Box>() ;
public Box (String label, int x, int y, Maze maze) {
this.label = label ;
this.x = x ;
this.y = y ;
this.maze = maze ;
}
public ArrayList<VertexInterface> generateNeighbors() {
return maze.generateNeighbours(this) ;
}
public boolean isWalkable() {
return true ;
}
public boolean isArrival() {
return false ;
}
public boolean isDeparture() {
return false ;
}
public ArrayList<Box> getNeighbourList() {
return neighbourList;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public String getLabel() {
return label;
}
public String toString() {
return "Label: " + label + ", x: " + x + ", y: " + y;
}
}