Package de.extio.spacecraft.shared.bo
Interface PathFinder
-
public interface PathFinder
Path finding (within a composite entity) You can access the corresponding bean implementation via EngineFacade::getBusinessObject / ServerFacade::getBusinessObject
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Path
find(AbstractCompositeEntity compositeEntity, CoordI2 origin, CoordI2 destination, PathFindingOptions options)
Calculates a path between two pointsboolean
isEntityAccessible(AbstractEntity entity, EntityDefManager entityDefManager, PathFindingOptions options)
Checks whether entity would block path findingboolean
isGenerateDebugNodes()
boolean
isMoveToDirectionAccessible(CoordI2 position, CoordI2 target, EntityManager entityManager, EntityDefManager entityDefManager, PathFindingOptions options)
Checks whether adjacent tile can be accessed from position (e.g.boolean
isTileAccessible(CoordI2 position, EntityManager entityManager, EntityDefManager entityDefManager, PathFindingOptions options)
Checks whether tile position can be accessed.CoordI2
processDestination(CoordI2 origin, CoordI2 destination, AbstractCompositeEntity compositeEntity, EntityDefManager entityDefManager, PathFindingOptions options)
Processes destination.void
setGenerateDebugNodes(boolean enabled)
-
-
-
Method Detail
-
find
Path find(AbstractCompositeEntity compositeEntity, CoordI2 origin, CoordI2 destination, PathFindingOptions options)
Calculates a path between two points- Parameters:
entityManager
- Composite entity populated with live entitiesorigin
- Start coordinatedestination
- Destination coordinate- Returns:
- null if no path could be found, otherwise the Path
-
isEntityAccessible
boolean isEntityAccessible(AbstractEntity entity, EntityDefManager entityDefManager, PathFindingOptions options)
Checks whether entity would block path finding- Parameters:
entity
-- Returns:
- true if entity does not block
-
isTileAccessible
boolean isTileAccessible(CoordI2 position, EntityManager entityManager, EntityDefManager entityDefManager, PathFindingOptions options)
Checks whether tile position can be accessed. Includes isEntityAccessible()- Parameters:
position
-entityManager
-entityDefManager
-options
-- Returns:
-
isMoveToDirectionAccessible
boolean isMoveToDirectionAccessible(CoordI2 position, CoordI2 target, EntityManager entityManager, EntityDefManager entityDefManager, PathFindingOptions options)
Checks whether adjacent tile can be accessed from position (e.g. checks that no wall blocks the way).- Parameters:
position
-target
-entityManager
-entityDefManager
-- Returns:
-
processDestination
CoordI2 processDestination(CoordI2 origin, CoordI2 destination, AbstractCompositeEntity compositeEntity, EntityDefManager entityDefManager, PathFindingOptions options)
Processes destination. Moves destination pointing to HULL mounted entity inside ship to service location. Sets destination to adjacent tile if destination is not accessible and feature is enabled in options.- Returns:
- May be null if destination is not accessible at all.
-
isGenerateDebugNodes
boolean isGenerateDebugNodes()
-
setGenerateDebugNodes
void setGenerateDebugNodes(boolean enabled)
-
-