Package com.csse3200.game.minigames.maze
Class Maze.BreadthFirstSearch
java.lang.Object
com.csse3200.game.minigames.maze.Maze.BreadthFirstSearch
- Enclosing class:
Maze
Class for bfs, used for finding paths in the maze (including the angular fish path to the player)
-
Constructor Summary
ConstructorsConstructorDescriptionBreadthFirstSearch
(com.badlogic.gdx.math.GridPoint2 startCell) BreadthFirstSearch
(List<com.badlogic.gdx.math.GridPoint2> startCells) bfs algorithm -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.math.GridPoint2
List
<com.badlogic.gdx.math.GridPoint2> getShortestPath
(com.badlogic.gdx.math.GridPoint2 end) Get the shortest path from initial grid cell to current
-
Constructor Details
-
BreadthFirstSearch
public BreadthFirstSearch(com.badlogic.gdx.math.GridPoint2 startCell) -
BreadthFirstSearch
bfs algorithm- Parameters:
startCells
- the initial position
-
-
Method Details
-
getShortestPath
Get the shortest path from initial grid cell to current- Parameters:
end
- the grid cell to search for- Returns:
- the shortest path
-
getMostDistant
public com.badlogic.gdx.math.GridPoint2 getMostDistant()- Returns:
- The most distant grid cell from the set of start locations in the BFS
-