LocalPathFinder

object LocalPathFinder

Types

Neighbors
Link copied to clipboard
enum Neighbors : Enum<LocalPathFinder.Neighbors>

Functions

buildPath
Link copied to clipboard
fun buildPath(last: LocalEdge): LocalPath
canUseDoor
Link copied to clipboard
fun GameObject.canUseDoor(): Boolean
contains
Link copied to clipboard
fun MutableList<LocalEdge>.contains(destination: Tile): Boolean
findPath
Link copied to clipboard
fun findPath(end: Tile?): LocalPath
fun findPath(begin: Tile, end: Tile, onlyWalk: Boolean = false, refreshFlags: Boolean = true): LocalPath
findWalkablePath
Link copied to clipboard
fun findWalkablePath(end: Tile): LocalPath
fun findWalkablePath(begin: Tile, end: Tile): LocalPath
getBest
Link copied to clipboard
fun getBest(open: Collection<LocalEdge>): LocalEdge?
getEdgeForDiagonalNeighbour
Link copied to clipboard
fun LocalEdge.getEdgeForDiagonalNeighbour(neighbor: Tile, flags: Array<IntArray>): Optional<LocalEdge>

If the given tile (diagonal neighbor) is not blocked, it gets added to the neighbors. If it is blocked, we check if there is a door that has a diagonal rotation Flag.Rotation.DIAGONAL

getLocalNeighbors
Link copied to clipboard
fun LocalEdge.getLocalNeighbors(flags: Array<IntArray> = cachedFlags, onlyWalk: Boolean = false): MutableList<LocalEdge>

Used to find neighbors of LocalEdge

getPassableObject
Link copied to clipboard
fun Tile.getPassableObject(orientation: Int): GameObject?
isDoor
Link copied to clipboard
fun GameObject.isDoor(): Boolean
isRockfall
Link copied to clipboard
fun GameObject.isRockfall(): Boolean
rockfallBlock
Link copied to clipboard
fun Tile.rockfallBlock(flags: Array<IntArray>): Boolean

Properties

actions
Link copied to clipboard
val actions: List<String>
blockedDoors
Link copied to clipboard
val blockedDoors: List<Tile>
cachedFlags
Link copied to clipboard
lateinit var cachedFlags: Array<IntArray>
doors
Link copied to clipboard
val doors: List<String>
logger
Link copied to clipboard
val logger: Logger
maxAttempts
Link copied to clipboard
val maxAttempts: Int = 2500