Even QCoordinates
Data class representing even-Q coordinates in a flat-topped hexagonal grid layout. The Even-Q coordinate system makes use of a 2D grid representation (column and row), which differs from the cube coordinates system used by the HexCoordinates:
In the HexCoordinates class, the hexagonal grid coordinates are denoted by three axes q, r, s, hence forming a cube structure.
The EvenQCoordinates class, on the other hand, interprets the hexagonal grid using a vertical column system aligned with even-Q. Here, the column ('q') has its origin at the top-left.
This layout causes every other column to be offset. Consequently, when progressing vertically in the positive direction, the even-numbered columns are slightly to the left of odd-numbered columns.
The col field denotes the column (equivalent to the q-axis in cube coordinates), while the row denotes the row.
The EvenQCoordinates class can be particularly useful when dealing with UI elements or graphical representations where Cartesian coordinates (column and row) are more intuitive to work with.
Properties
Expects a property of HexCoordinates type, which should be provided by instances of this interface.
Functions
Retrieves neighbouring grid element in the particular direction.
Transforms the given this from HexCoordinates into the corresponding subtype of Coordinates.