Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-04-27 10:27:54 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-04-27 10:27:54 -0700
commit0c693a03832c9b47f2ca4c718640e02abce80c71 (patch)
tree1928c956a51fb9755cfdcd365eaeec7947383c56 /src/modules
parent9aada19dbd36f45dc50a2dc745dfc613feac675d (diff)
Move function into closure
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/game.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/game.js b/src/modules/game.js
index 2633320..485362b 100644
--- a/src/modules/game.js
+++ b/src/modules/game.js
@@ -12,10 +12,6 @@ function getGridIndex({ parentElement: { dataset: { x }, parentElement: { datase
return { x: +x, y: +y };
}
-function getCounterAtGridIndex(x, y) {
- return getCell(x, y).querySelector('.counter');
-}
-
function getHex(cell) {
return cell.querySelector('use[href="#hex"]');
}
@@ -235,6 +231,10 @@ export default function (svg) {
return svg.querySelector(`g[data-y="${y}"] > g[data-x="${x}"]`);
}
+ function getCounterAtGridIndex(x, y) {
+ return getCell(x, y).querySelector('.counter');
+ }
+
function getSelected() {
return svg.querySelector(`.counter.selected[data-allegiance][data-number]`);
}