UNPKG

@rickosborne/hexgrid

Version:

Rick Osborne's collection of hexagonal grid-related code.

48 lines (47 loc) 1.64 kB
var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); import { AXIAL } from "./hex-system.mjs"; const AXIAL_FLAT_SE = Object.freeze({ q: 1, r: 0, system: AXIAL }); const AXIAL_FLAT_NE = Object.freeze({ q: 1, r: -1, system: AXIAL }); const AXIAL_FLAT_N = Object.freeze({ q: 0, r: -1, system: AXIAL }); const AXIAL_FLAT_NW = Object.freeze({ q: -1, r: 0, system: AXIAL }); const AXIAL_FLAT_SW = Object.freeze({ q: -1, r: 1, system: AXIAL }); const AXIAL_FLAT_S = Object.freeze({ q: 0, r: 1, system: AXIAL }); const AXIAL_POINTY_E = AXIAL_FLAT_SE; const AXIAL_POINTY_NE = AXIAL_FLAT_NE; const AXIAL_POINTY_NW = AXIAL_FLAT_N; const AXIAL_POINTY_W = AXIAL_FLAT_NW; const AXIAL_POINTY_SW = AXIAL_FLAT_SW; const AXIAL_POINTY_SE = AXIAL_FLAT_S; const AXIAL_DIRECTIONS = Object.freeze([ AXIAL_FLAT_SE, AXIAL_FLAT_NE, AXIAL_FLAT_N, AXIAL_FLAT_NW, AXIAL_FLAT_SW, AXIAL_FLAT_S ]); const axialFromQR = /* @__PURE__ */ __name((q, r) => ({ q, r, system: AXIAL }), "axialFromQR"); const stringifyAxial = /* @__PURE__ */ __name(({ q, r }) => `Axial<${q},${r}>`, "stringifyAxial"); const AXIAL_ORIGIN = Object.freeze({ q: 0, r: 0, system: AXIAL }); const AXIAL_EPSILON = Object.freeze({ q: 1e-6, r: 1e-6, system: AXIAL }); export { AXIAL_DIRECTIONS, AXIAL_EPSILON, AXIAL_FLAT_N, AXIAL_FLAT_NE, AXIAL_FLAT_NW, AXIAL_FLAT_S, AXIAL_FLAT_SE, AXIAL_FLAT_SW, AXIAL_ORIGIN, AXIAL_POINTY_E, AXIAL_POINTY_NE, AXIAL_POINTY_NW, AXIAL_POINTY_SE, AXIAL_POINTY_SW, AXIAL_POINTY_W, axialFromQR, stringifyAxial }; //# sourceMappingURL=axial.mjs.map