Interface IMazeModel
- All Known Implementing Classes:
MazeModel
public interface IMazeModel
Interface for MazeModel.
Specifies the methods that the MazeModel should implement.
These include methods for getting and setting rows, columns, goal coordinates,
and methods for generating and accessing the maze structure.
-
Method Summary
Modifier and TypeMethodDescriptionvoidGenerates the maze using the randomized Prime's algorithm.intgetCols()Gets the number of columns in the maze.intgetGoalX()Gets the x-coordinate of the goal position in the maze.intgetGoalY()Gets the y-coordinate of the goal position in the maze.int[][]getMaze()Gets the maze structure as a two-dimensional array.intgetRows()Gets the number of rows in the maze.intGets the x-coordinate of the start position in the maze.intGets the y-coordinate of the start position in the maze.voidsetCols(int cols) Sets the number of columns in the maze.voidsetRows(int rows) Sets the number of rows in the maze.
-
Method Details
-
getRows
int getRows()Gets the number of rows in the maze.- Returns:
- The number of rows.
-
setRows
void setRows(int rows) Sets the number of rows in the maze.- Parameters:
rows- The number of rows to set.
-
getCols
int getCols()Gets the number of columns in the maze.- Returns:
- The number of columns.
-
setCols
void setCols(int cols) Sets the number of columns in the maze.- Parameters:
cols- The number of columns to set.
-
getGoalX
int getGoalX()Gets the x-coordinate of the goal position in the maze.- Returns:
- The x-coordinate of the goal.
-
getGoalY
int getGoalY()Gets the y-coordinate of the goal position in the maze.- Returns:
- The y-coordinate of the goal.
-
getStartX
int getStartX()Gets the x-coordinate of the start position in the maze.- Returns:
- The x-coordinate of the start.
-
getStartY
int getStartY()Gets the y-coordinate of the start position in the maze.- Returns:
- The y-coordinate of the start.
-
getMaze
int[][] getMaze()Gets the maze structure as a two-dimensional array. 0 means the cell is accessible, 1 means the cell is a wall.- Returns:
- The maze structure.
-
generateMaze
void generateMaze()Generates the maze using the randomized Prime's algorithm.
-