Coordinates

The Coordinates interface is a generic contract for types which extend or implement Coordinates themselves. It provides constant directions for two hexagonal coordinate systems, Flat-top and Pointy-top.

The Flat object has six directions, starting from 'right-bottom' and moving counter-clockwise. The Pointy object also has six directions, starting from 'right' and moving counter-clockwise.

Parameters

T

This represents the type of the Coordinates, which is a subtype of Coordinates itself.

Inheritors

Types

Link copied to clipboard
object Flat

Enumeration of direction constants for Flat-top hexagonal layout. Directions start from 'RightBottom' and move counter-clockwise.

Link copied to clipboard
object Pointy

Enumeration of direction constants for Pointy-top hexagonal layout. Directions start from 'Right' and move counter-clockwise.

Properties

Link copied to clipboard
abstract val hex: HexCoordinates

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

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.