Package visualizationElements
Klasse Maze
java.lang.Object
visualizationElements.VisualizationElement
visualizationElements.Maze
Represents a maze to visualize.
-
Feldübersicht
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Draws the visualization element.private void
Generates ways through a maze full of walls.getAllCellNeighbours
(Cell currentCell) Gets all neighbors of a cell.int
Cell[][]
getMaze()
getUnvisitedCellNeighbors
(Cell currentCell) Gets all unvisited neighbors of a cell.int
getWidth()
private void
initMaze()
Initializes the maze.private void
Initializes a Maze full of walls.private void
removeCellsEastWall
(int column, int row) Removes a cell's east wall.private void
removeCellsNorthWall
(int column, int row) Removes a cell's north wall.private void
removeCellsSouthWall
(int column, int row) Removes a cell's south wall.private void
removeCellsWestWall
(int column, int row) Removes a cell's west wall.private void
removeWallBetweenCurrentCellAndNeighbour
(Cell cell, Cell neighbor) Removes the wall between two cells.void
setHeigth
(int heigth) void
void
setWidth
(int width)
-
Felddetails
-
CELL_WIDTH
private static final int CELL_WIDTH- Siehe auch:
-
CELL_HEIGTH
private static final int CELL_HEIGTH- Siehe auch:
-
START_X_POS
private static final int START_X_POS- Siehe auch:
-
START_Y_POS
private static final int START_Y_POS- Siehe auch:
-
maze
-
currentCell
-
heigth
private int heigth -
width
private int width -
xpos
private int xpos -
ypos
private int ypos -
cellStack
-
-
Konstruktordetails
-
Maze
public Maze(int heigth, int width) Creates a new Maze.- Parameter:
heigth
- Height of the Maze.width
- Width of the Maze.
-
-
Methodendetails
-
draw
Beschreibung aus Klasse kopiert:VisualizationElement
Draws the visualization element.- Angegeben von:
draw
in KlasseVisualizationElement
- Parameter:
g
- The Graphics object to draw the element to the DrawArea.
-
setMaze
- Parameter:
maze
- the maze to set
-
getMaze
- Gibt zurück:
- the maze
-
setHeigth
public void setHeigth(int heigth) - Parameter:
heigth
- the heigth to set
-
getHeigth
public int getHeigth()- Gibt zurück:
- the heigth
-
setWidth
public void setWidth(int width) - Parameter:
width
- the width to set
-
getWidth
public int getWidth()- Gibt zurück:
- the width
-
initMaze
private void initMaze()Initializes the maze. -
initMazeWithAllWalls
private void initMazeWithAllWalls()Initializes a Maze full of walls. -
generateWays
private void generateWays()Generates ways through a maze full of walls. -
removeCellsSouthWall
private void removeCellsSouthWall(int column, int row) Removes a cell's south wall.- Parameter:
column
- Column of the cell.row
- Row of the cell.
-
removeCellsNorthWall
private void removeCellsNorthWall(int column, int row) Removes a cell's north wall.- Parameter:
column
- Column of the cell.row
- Row of the cell.
-
removeCellsEastWall
private void removeCellsEastWall(int column, int row) Removes a cell's east wall.- Parameter:
column
- Column of the cell.row
- Row of the cell.
-
removeCellsWestWall
private void removeCellsWestWall(int column, int row) Removes a cell's west wall.- Parameter:
column
- Column of the cell.row
- Row of the cell.
-
removeWallBetweenCurrentCellAndNeighbour
Removes the wall between two cells.- Parameter:
cell
- Cell to remove a wall.neighbor
- The Cell's neighbour to remove the corresponding wall.
-
getUnvisitedCellNeighbors
Gets all unvisited neighbors of a cell.- Parameter:
currentCell
- The cell to get the neighbors.- Gibt zurück:
- The cell's unvisited neighbors.
-
getAllCellNeighbours
Gets all neighbors of a cell.- Parameter:
currentCell
- The cell to get the neighbors.- Gibt zurück:
- The cell's neighbors.
-