Class FindPath
java.lang.Object
com.deco2800.game.areas.MapGenerator.pathBuilding.FindPath
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<com.badlogic.gdx.math.GridPoint2>
findPathBetween
(com.badlogic.gdx.math.GridPoint2 start, com.badlogic.gdx.math.GridPoint2 finish) Finds a path between two points using BFS search.List<com.badlogic.gdx.math.GridPoint2>
getPath
(com.badlogic.gdx.math.GridPoint2 start) Finds a path between two points using BFS search.
-
Constructor Details
-
FindPath
Constructs an instance of FindPath. Used for finding a path between two tiles.- Parameters:
pg
- an instance of PathGenerator
-
-
Method Details
-
findPathBetween
public List<com.badlogic.gdx.math.GridPoint2> findPathBetween(com.badlogic.gdx.math.GridPoint2 start, com.badlogic.gdx.math.GridPoint2 finish) Finds a path between two points using BFS search.- Parameters:
start
- the starting positionfinish
- the end position- Returns:
- a list of positions indicating the shortest path
-
getPath
Finds a path between two points using BFS search.- Parameters:
start
- the starting position- Returns:
- a list of positions indicating the shortest path
-