fieldOfView

fun fieldOfView(from: AxisPoint, doesBlockVision: (Int, Int) -> Boolean): Set<HexCoordinates>(source)

Generates a field of view from a specified point.

Return

A set of HexCoordinates that represents all visible coordinates in the field of view.

Parameters

from

The starting point of the field of view.

doesBlockVision

A function to indicate whether a coordinate blocks vision.


fun fieldOfView(from: AxisPoint, doesBlockVision: (Int, Int) -> Boolean, callback: (Int, Int) -> Unit)(source)

Generates a field of view from a specified point.

Parameters

from

The starting point of the field of view.

doesBlockVision

A function to indicate whether a coordinate blocks vision.

callback

An optional callback function that is called for every visible coordinate in the field of view.


fun fieldOfView(fromQ: Int, fromR: Int, doesBlockVision: (Int, Int) -> Boolean, callback: (Int, Int) -> Unit = { _, _ -> })(source)

Generates a field of view from a specified point.

Parameters

fromQ

The starting point (q) of the field of view.

fromR

The starting point (r) of the field of view.

doesBlockVision

A function to indicate whether a coordinate blocks vision.

callback

An optional callback function that is called for every visible coordinate in the field of view.