Package-level declarations

Types

Link copied to clipboard
data class AccessibilityTrie<T>(val origin: T, val maxMoveCost: Int, val neighbors: (T) -> List<T>, val isWalkable: (T) -> Boolean, val distance: (T, T) -> Int, val movementCost: (T, T) -> Double)

A data class that represents a trie structure for accessibility in a hexagonal grid. Used for pathfinding and accessibility checks. Uses the A* algorithm to build the trie structure.

Link copied to clipboard
interface PathTile<T : PathTile<T>>

Represents a path tile with generic type T.

Link copied to clipboard

A provider for pre-computed tries for the line of sight (LoS) on a symmetric grid.

Link copied to clipboard
data class TrieNode(val parent: TrieNode? = null, val q: Int, val r: Int, val childrenIndices: MutableList<Int?> = MutableList(10) { null })

Data class defining a trie node for the SymmetricPreComputedVisionTries.

Functions

Link copied to clipboard
fun <T : PathTile<T>> aStar(from: T, to: T, neighbors: (T) -> List<T>): List<T>
fun <T> aStar(from: T, to: T, neighbors: (T) -> List<T>, isWalkable: (T) -> Boolean, distance: (T, T) -> Int, movementCost: (T, T) -> Double): List<T>

Applies the A* pathfinding algorithm on a given graph to find the shortest path from the start point from to the destination to.