const Utils = { hexToKey(hex) { return `${hex.q},${hex.r}`; }, keyToHex(key) { const [q, r] = key.split(',').map(Number); return { q, r }; }, // Screen/canvas coordinate utilities screenToCanvas(x, y, camera) { return { x: x + camera.x, y: y + camera.y }; }, canvasToScreen(x, y, camera) { return { x: x - camera.x, y: y - camera.y }; } };