Class AStar
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.sea.AStar
-
@Component @Lazy @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class) public class AStar extends java.lang.ObjectImplementation of the A* pathfinding algorithm. Implementation is based on this code review: http://codereview.stackexchange.com/questions/38376/a-search-algorithm- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Jan 01, 2016
-
-
Constructor Summary
Constructors Constructor Description AStar()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<javafx.geometry.Point2D>findPath(javafx.geometry.Point2D source, javafx.geometry.Point2D destination)Implements the A-star algorithm and returns the path from source to destination
-
-
-
Method Detail
-
findPath
public java.util.List<javafx.geometry.Point2D> findPath(javafx.geometry.Point2D source, javafx.geometry.Point2D destination)Implements the A-star algorithm and returns the path from source to destination- Parameters:
source- the source nodeiddestination- the destination nodeid- Returns:
- the path from source to destination
-
-