HexCoordinates

A data class representing a point in a hexagonal grid using cube coordinates (q, r, s). The s coordinate is calculated based on q and r as -q - r.

Constructors

Link copied to clipboard
constructor(q: Int, r: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val hex: HexCoordinates

Expects a property of HexCoordinates type, which should be provided by instances of this interface.

Link copied to clipboard
Link copied to clipboard
open override val q: Int

The column coordinate of the point on the hexagonal grid.

Link copied to clipboard
open override val r: Int

The row coordinate of the point on the hexagonal grid.

Link copied to clipboard
val s: Int

Functions

Link copied to clipboard
operator fun component3(): Int
Link copied to clipboard
operator fun get(direction: Int): HexCoordinates

Retrieves the neighboring HexCoordinates in the specified direction.

Link copied to clipboard
open override fun HexCoordinates.into(): HexCoordinates

Transforms the given this from HexCoordinates into the corresponding subtype of Coordinates.

Link copied to clipboard
operator fun minus(other: HexCoordinates): HexCoordinates
Link copied to clipboard
operator fun plus(other: HexCoordinates): HexCoordinates