Package mazealgo.model.algorithms.maze3D
Class Maze3D
java.lang.Object
mazealgo.model.algorithms.maze3D.Maze3D
- All Implemented Interfaces:
Serializable
A 3D maze: an int cube where 1 is a wall and 0 is a passable cell,
with a start position and a goal position.
Serializable so the server can return a generated 3D maze to the client over an ObjectOutputStream.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCell(int depth, int row, int column) intintgetDepth()int[][][]getMap()Required by the spec (page 15): exposes the underlying 3D grid.intgetRows()voidprint()Prints the maze layer by layer.voidsetCell(int depth, int row, int column, int value) voidsetGoalPosition(Position3D goal) voidsetStartPosition(Position3D start)
-
Constructor Details
-
Maze3D
public Maze3D(int depth, int rows, int columns)
-
-
Method Details
-
getDepth
public int getDepth() -
getRows
public int getRows() -
getColumns
public int getColumns() -
getMap
public int[][][] getMap()Required by the spec (page 15): exposes the underlying 3D grid. Callers should treat the returned array as read-only. -
getCell
public int getCell(int depth, int row, int column) -
setCell
public void setCell(int depth, int row, int column, int value) -
getStartPosition
-
setStartPosition
-
getGoalPosition
-
setGoalPosition
-
print
public void print()Prints the maze layer by layer. Walls are 1, passages are 0, the start is marked S and the goal is marked E.
-