Interface PathfinderResult
- All Known Implementing Classes:
PathfinderResultImpl
public interface PathfinderResult
The result of a pathfinding operation.
Pathfinding results are used to encapsulate the outcome of a pathfinding operation. They provide information about the success of the operation and the resulting path.
-
Method Summary
Modifier and TypeMethodDescriptiongetPath()Returns the foundPathregardless if successful or not.Returns the state of the pathfinding.booleanWhether the pathfinder has failed to reach its target.booleanWhether a pathfinder has resulted in a fallback.booleanReturns whether the pathfinding was successful.
-
Method Details
-
successful
boolean successful()Returns whether the pathfinding was successful.- Returns:
- true if the pathfinding was successful
-
hasFailed
boolean hasFailed()Whether the pathfinder has failed to reach its target. This includesPathState.FAILED,PathState.LENGTH_LIMITED,PathState.MAX_ITERATIONS_REACHEDandPathState.FALLBACK- Returns:
- Whether the pathfinder has failed to reach its target
-
hasFallenBack
boolean hasFallenBack()Whether a pathfinder has resulted in a fallback.- Returns:
- Whether a pathfinder has resulted in a fallback
-
getPathState
PathState getPathState()Returns the state of the pathfinding.- Returns:
- The
PathState
-
getPath
Path getPath()Returns the foundPathregardless if successful or not. The path is empty if the pathfinding failed.- Returns:
- The found
Path
-