Package-level declarations
Provides the classes and interfaces for representing different coordinates in hexagonal grid layouts. The key components of this package are:
Coordinates
: This interface sets a general contract for types that implement or extend Coordinates. It provides constant directions for two specific coordinate layouts: Flat-top and Pointy-top hexagonal grids. FractionalHexCoordinates: This class is used to represent the fractional parts of a hexagonal coordinate.
HexCoordinates: This class represents a point in a hexagonal grid using a cubical coordinate system (q, r, s).
Offset and Doubled Coordinate Classes: This package includes a variety of classes derived from the Coordinates interface. These classes are used to represent different types of hexagonal layouts, like offset (even or odd) or doubled (width or height) coordinates.
Types
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.
This interface provides a single method to transform instances of HexCoordinates into an arbitrary, but specific, subtype of Coordinates. This is particularly useful when functions generate new values inside a specific coordinate system and these need to be represented, or 'converted', into another domain-specific coordinate system.