Class Maze3D

java.lang.Object
mazealgo.model.algorithms.maze3D.Maze3D
All Implemented Interfaces:
Serializable

public class Maze3D extends Object implements 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 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

      public Position3D getStartPosition()
    • setStartPosition

      public void setStartPosition(Position3D start)
    • getGoalPosition

      public Position3D getGoalPosition()
    • setGoalPosition

      public void setGoalPosition(Position3D goal)
    • 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.