Interface IFindPathStrategy
- All Known Implementing Classes:
AstarStrategy,DfsStrategy
public interface IFindPathStrategy
Interface for pathfinding strategy in a maze.
This interface defines the method for finding a path in a maze model.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanfindPath(IMazeModel mazeModel, List<int[]> path, boolean[][] visited, int x, int y, int goalX, int goalY) Finds a path from the starting position to the goal position in the given maze model.
-
Method Details
-
findPath
boolean findPath(IMazeModel mazeModel, List<int[]> path, boolean[][] visited, int x, int y, int goalX, int goalY) Finds a path from the starting position to the goal position in the given maze model.- Parameters:
mazeModel- The maze model containing the maze structure.path- A list to store the path found from start to goal.visited- A 2D boolean array to keep track of visited positions in the maze.x- The x-coordinate of the current position.y- The y-coordinate of the current position.goalX- The x-coordinate of the goal position.goalY- The y-coordinate of the goal position.- Returns:
- True if a path is found, false otherwise.
-