Class Maze.BreadthFirstSearch

java.lang.Object
com.csse3200.game.minigames.maze.Maze.BreadthFirstSearch
Enclosing class:
Maze

public class Maze.BreadthFirstSearch extends Object
Class for bfs, used for finding paths in the maze (including the angular fish path to the player)
  • Constructor Details

    • BreadthFirstSearch

      public BreadthFirstSearch(com.badlogic.gdx.math.GridPoint2 startCell)
    • BreadthFirstSearch

      public BreadthFirstSearch(List<com.badlogic.gdx.math.GridPoint2> startCells)
      bfs algorithm
      Parameters:
      startCells - the initial position
  • Method Details

    • getShortestPath

      public List<com.badlogic.gdx.math.GridPoint2> getShortestPath(com.badlogic.gdx.math.GridPoint2 end)
      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