Package-level declarations

Types

Link copied to clipboard

Possible options for how to lay out the grid in the dimension perpendicular to the one that determines the cell size.

Link copied to clipboard

Possible options for determining the hex cell size.

Link copied to clipboard
interface Grid

The library's specialized state collection that allows indexing by the particular address system used here.

Link copied to clipboard

Possible options for the orientation of the cell hexagons.

Link copied to clipboard

The mutable version of the library's Grid structure.

Link copied to clipboard
sealed interface StateMapBuilderScope

Scope for assembling State maps. For use with buildStateMap.

Properties

Link copied to clipboard

An empty Grid instance for use as an initial value, a reset value, etc.

Link copied to clipboard

Convenience for concisely checking the hex orientation.

Functions

Link copied to clipboard

Provides a scope in which to build a Map using convenience functions.

Link copied to clipboard
fun MutableGrid.change(address: Grid.Address, isVisible: Boolean = this[address].isVisible, isSelected: Boolean = this[address].isSelected)

Updates the Grid.State at the given Grid.Address.

Link copied to clipboard
inline fun <T : Grid> T.changed(address: Grid.Address, isVisible: Boolean = this[address].isVisible, isSelected: Boolean = this[address].isSelected): T

Returns a modified copy of the Grid with the specified Grid.State update at the given Grid.Address.

Link copied to clipboard
fun Grid.Address.isAt(row: Int, column: Int): Boolean

Convenience to concisely check an Address against individual indices.

Link copied to clipboard

Toggles the Grid.State.isSelected value at the given Grid.Address.

Link copied to clipboard
inline fun <T : Grid> T.toggled(address: Grid.Address): T

Returns a modified copy of the Grid with the Grid.State.isSelected value toggled at the given Grid.Address.