java.lang.Object
com.deco2800.game.areas.MapGenerator.pathBuilding.FindPath

public class FindPath extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an instance of FindPath.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    List<com.badlogic.gdx.math.GridPoint2>
    getPath(com.badlogic.gdx.math.GridPoint2 start)
    Finds a path between two points using BFS search.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FindPath

      public FindPath(PathGenerator pg)
      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 position
      finish - the end position
      Returns:
      a list of positions indicating the shortest path
    • getPath

      public List<com.badlogic.gdx.math.GridPoint2> getPath(com.badlogic.gdx.math.GridPoint2 start)
      Finds a path between two points using BFS search.
      Parameters:
      start - the starting position
      Returns:
      a list of positions indicating the shortest path