lineOfSight

fun lineOfSight(from: AxisPoint, to: AxisPoint, radius: Int = this.radius, doesBlockVision: (Int, Int) -> Boolean): Set<HexCoordinates>(source)

Converts provided coordinates into line-of-sight data.

Return

A set of HexCoordinates that represents all visible coordinates in the line-of-sight from the start to the end point.

Parameters

from

The starting point of the line-of-sight.

to

The ending point of the line-of-sight.

radius

The vision radius (default is the class's instance radius).

doesBlockVision

A function that checks whether the line-of-sight is blocked.


fun lineOfSight(from: AxisPoint, to: AxisPoint, radius: Int = this.radius, doesBlockVision: (Int, Int) -> Boolean, callback: (Int, Int) -> Unit): Boolean(source)

Converts provided coordinates into line-of-sight data.

Return

true if the line-of-sight is not blocked, false otherwise.

Parameters

from

The starting point of the line-of-sight.

to

The ending point of the line-of-sight.

radius

The vision radius (default is the class's instance radius).

doesBlockVision

A function that checks whether the line-of-sight is blocked.

callback

A callback function that is called for each visible coordinate.


fun lineOfSight(fromQ: Int, fromR: Int, toQ: Int, toR: Int, radius: Int = this.radius, doesBlockVision: (Int, Int) -> Boolean, callback: (Int, Int) -> Unit): Boolean(source)

Converts provided coordinates into line-of-sight data.

Return

true if the line-of-sight is not blocked, false otherwise.

Parameters

fromQ

The starting point of the line-of-sight (q).

fromR

The starting point of the line-of-sight (r).

toQ

The ending point of the line-of-sight (q).

toR

The ending point of the line-of-sight (r).

radius

The vision radius (default is the class's instance radius).

doesBlockVision

A function that checks whether the line-of-sight is blocked.

callback

A callback function that is called for each visible coordinate.