UNPKG

@rickosborne/hexgrid

Version:

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

62 lines (61 loc) 2.11 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var offset_exports = {}; __export(offset_exports, { OFFSET_DIRECTIONS: () => OFFSET_DIRECTIONS, OFFSET_Q_N: () => OFFSET_Q_N, OFFSET_Q_NE: () => OFFSET_Q_NE, OFFSET_Q_NW: () => OFFSET_Q_NW, OFFSET_Q_S: () => OFFSET_Q_S, OFFSET_Q_SE: () => OFFSET_Q_SE, OFFSET_Q_SW: () => OFFSET_Q_SW, OFFSET_R_E: () => OFFSET_R_E, OFFSET_R_NE: () => OFFSET_R_NE, OFFSET_R_NW: () => OFFSET_R_NW, OFFSET_R_SE: () => OFFSET_R_SE, OFFSET_R_SW: () => OFFSET_R_SW, OFFSET_R_W: () => OFFSET_R_W, stringifyOffset: () => stringifyOffset }); module.exports = __toCommonJS(offset_exports); const OFFSET_R_E = 0; const OFFSET_R_NE = 1; const OFFSET_R_NW = 2; const OFFSET_R_W = 3; const OFFSET_R_SW = 4; const OFFSET_R_SE = 5; const OFFSET_Q_SE = OFFSET_R_E; const OFFSET_Q_NE = OFFSET_R_NE; const OFFSET_Q_N = OFFSET_R_NW; const OFFSET_Q_NW = OFFSET_R_W; const OFFSET_Q_SW = OFFSET_R_SW; const OFFSET_Q_S = OFFSET_R_SE; const OFFSET_DIRECTIONS = Object.freeze([ OFFSET_Q_SE, OFFSET_Q_NE, OFFSET_Q_N, OFFSET_Q_NW, OFFSET_Q_SW, OFFSET_Q_S ]); const stringifyOffset = /* @__PURE__ */ __name(({ row, col, system }) => { return `${system}<${col},${row}>`; }, "stringifyOffset"); //# sourceMappingURL=offset.cjs.map