index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-04-27 10:27:54 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-04-27 10:27:54 -0700 |
commit | 0c693a03832c9b47f2ca4c718640e02abce80c71 (patch) | |
tree | 1928c956a51fb9755cfdcd365eaeec7947383c56 /src/modules | |
parent | 9aada19dbd36f45dc50a2dc745dfc613feac675d (diff) |
Move function into closure
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/game.js | 8 |
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]`); } |