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-24 15:50:59 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-04-24 15:50:59 -0700 |
commit | 62a745d59f27c55f2c3689d2bebdc11684621e7b (patch) | |
tree | 10e0bb1d0a17d3e69c7ff1f76a13c4ccc6718333 /src/modules/game.js | |
parent | f215ef7920aa686276ffb2aeb24df3340774619f (diff) |
Change troop-number and troop-allegiance references to just number and allegiance
Diffstat (limited to 'src/modules/game.js')
-rw-r--r-- | src/modules/game.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/modules/game.js b/src/modules/game.js index d6059ae..2810fba 100644 --- a/src/modules/game.js +++ b/src/modules/game.js @@ -50,8 +50,8 @@ export default class Game { return this.svg.querySelector('line.sight-line'); } - getExistingArcs(al, n) { - return this.svg.querySelectorAll(`#firing-arcs polygon[data-number="${n}"][data-allegiance="${al}"]`); + getExistingArcs({ dataset: { allegiance, number }}) { + return this.svg.querySelectorAll(`#firing-arcs polygon[data-number="${number}"][data-allegiance="${allegiance}"]`); } getUnclippedFiringArcs() { @@ -99,14 +99,14 @@ export default class Game { } } - select({ dataset: { allegiance, number } }) { - const counter = this.counter.getCounter(allegiance, number); + select(selected) { + const counter = this.counter.getCounter(selected); if (counter) { this.unSelect(); this.placing.push(counter); counter.classList.add(this.counter.selectedClass); - this.getExistingArcs(allegiance, number).forEach(el => el.removeAttribute('clip-path')); + this.getExistingArcs(counter).forEach(el => el.removeAttribute('clip-path')); this.selectCallback({ prone: this.counter.hasProne(counter), ...counter.dataset }); } } @@ -185,8 +185,6 @@ export default class Game { contents: this.getCellContents(cell) }; - console.log(state); - let toPlace = this.placing.pop(); if (isGrenade(toPlace)) { |