import { Vector } from './Vector'; /** * The coordinates of a hexagon. * * The coordinates, q and r, are distances along two axes that are at a 60° angle. * * A third coordinate, s, is derived from q and r such that q + r + s = 0. * The s coordinate represents the distance along the third hexagonal axis * (at 60° to both the q and r axes). * * See https://www.redblobgames.com/grids/hexagons/#coordinates-axial for details. */ export declare class Hex { /** Origin hex (0, 0). */ static readonly Origin: Hex; /** Hex in the positive Q direction (1, 0). */ static readonly PosQ: Hex; /** Hex in the positive R direction (0, 1). */ static readonly PosR: Hex; /** Hex in the positive S direction (1, -1). */ static readonly PosS: Hex; /** Hex in the negative Q direction (-1, 0). */ static readonly NegQ: Hex; /** Hex in the negative R direction (0, -1). */ static readonly NegR: Hex; /** Hex in the negative S direction (-1, 1). */ static readonly NegS: Hex; /** * All six hex directions, starting with positive Q, then positive R, * and continuing around in a circle. */ static readonly Directions: ReadonlyArray; /** * Create a hex from a key string. * * The key should be string consisting of the decimal integer representations * of the q and r coordinates separated by an underscore. * * See the key() method. */ static fromKey(key: string): Hex; /** * Returns the closest integer-coordinate hex to the given vector, * which is interpreted to be in axial space. * * See https://www.redblobgames.com/grids/hexagons/#coordinates-axial for details. */ static fromAxialVector(v: Vector): Hex; /** The q coordinate. */ readonly q: number; /** The r coordinate. */ readonly r: number; /** Construct a hex from its q and r coordinates. */ constructor(q: number, r: number); /** * Returns the s coordinate. * * Derived from q and r such that q + r + s = 0. * * See https://www.redblobgames.com/grids/hexagons/#coordinates-axial for details. */ s(): number; /** * Returns the string key for this hex. * * The key consists of the decimal integer representations * of the q and r coordinates separated by an underscore. */ key(): string; /** Returns true if this hex has the same coordinates as the given hex. */ equals(h: Hex): boolean; /** Returns the "length" of this hex, when treated as a vector from the origin. */ length(): number; /** Returns the distance from this hex to the given hex. */ distanceTo(h: Hex): number; /** Returns the hex that results from adding this hex to the given hex. */ plus(h: Hex): Hex; /** Returns the hex that results from subtracting the given hex from this hex. */ minus(h: Hex): Hex; /** Returns a vector, in axial space, to the center of the hex. */ toAxialVector(): Vector; }