SymmetricPreComputedVisionTries

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

This class provides you with the ability to pre-compute the tries in order to enhance the speed of common operations e.g., line-of-sight (LoS), field-of-view (FoV), etc.

Parameters

radius

the vision radius for the tries.

Constructors

Link copied to clipboard
constructor(radius: Int)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun fieldOfView(from: AxisPoint, doesBlockVision: (Int, Int) -> Boolean): Set<HexCoordinates>
fun fieldOfView(from: AxisPoint, doesBlockVision: (Int, Int) -> Boolean, callback: (Int, Int) -> Unit)
fun fieldOfView(fromQ: Int, fromR: Int, doesBlockVision: (Int, Int) -> Boolean, callback: (Int, Int) -> Unit = { _, _ -> })

Generates a field of view from a specified point.

Link copied to clipboard
fun lineOfSight(from: AxisPoint, to: AxisPoint, radius: Int = this.radius, doesBlockVision: (Int, Int) -> Boolean): Set<HexCoordinates>
fun lineOfSight(from: AxisPoint, to: AxisPoint, radius: Int = this.radius, doesBlockVision: (Int, Int) -> Boolean, callback: (Int, Int) -> Unit): Boolean
fun lineOfSight(fromQ: Int, fromR: Int, toQ: Int, toR: Int, radius: Int = this.radius, doesBlockVision: (Int, Int) -> Boolean, callback: (Int, Int) -> Unit): Boolean

Converts provided coordinates into line-of-sight data.