@rickosborne/hexgrid
Version:
Rick Osborne's collection of hexagonal grid-related code.
67 lines (66 loc) • 3.02 kB
JavaScript
;
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 axial_exports = {};
__export(axial_exports, {
AXIAL_DIRECTIONS: () => AXIAL_DIRECTIONS,
AXIAL_EPSILON: () => AXIAL_EPSILON,
AXIAL_FLAT_N: () => AXIAL_FLAT_N,
AXIAL_FLAT_NE: () => AXIAL_FLAT_NE,
AXIAL_FLAT_NW: () => AXIAL_FLAT_NW,
AXIAL_FLAT_S: () => AXIAL_FLAT_S,
AXIAL_FLAT_SE: () => AXIAL_FLAT_SE,
AXIAL_FLAT_SW: () => AXIAL_FLAT_SW,
AXIAL_ORIGIN: () => AXIAL_ORIGIN,
AXIAL_POINTY_E: () => AXIAL_POINTY_E,
AXIAL_POINTY_NE: () => AXIAL_POINTY_NE,
AXIAL_POINTY_NW: () => AXIAL_POINTY_NW,
AXIAL_POINTY_SE: () => AXIAL_POINTY_SE,
AXIAL_POINTY_SW: () => AXIAL_POINTY_SW,
AXIAL_POINTY_W: () => AXIAL_POINTY_W,
axialFromQR: () => axialFromQR,
stringifyAxial: () => stringifyAxial
});
module.exports = __toCommonJS(axial_exports);
var import_hex_system = require("./hex-system.cjs");
const AXIAL_FLAT_SE = Object.freeze({ q: 1, r: 0, system: import_hex_system.AXIAL });
const AXIAL_FLAT_NE = Object.freeze({ q: 1, r: -1, system: import_hex_system.AXIAL });
const AXIAL_FLAT_N = Object.freeze({ q: 0, r: -1, system: import_hex_system.AXIAL });
const AXIAL_FLAT_NW = Object.freeze({ q: -1, r: 0, system: import_hex_system.AXIAL });
const AXIAL_FLAT_SW = Object.freeze({ q: -1, r: 1, system: import_hex_system.AXIAL });
const AXIAL_FLAT_S = Object.freeze({ q: 0, r: 1, system: import_hex_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: import_hex_system.AXIAL }), "axialFromQR");
const stringifyAxial = /* @__PURE__ */ __name(({ q, r }) => `Axial<${q},${r}>`, "stringifyAxial");
const AXIAL_ORIGIN = Object.freeze({ q: 0, r: 0, system: import_hex_system.AXIAL });
const AXIAL_EPSILON = Object.freeze({ q: 1e-6, r: 1e-6, system: import_hex_system.AXIAL });
//# sourceMappingURL=axial.cjs.map