diff options
author | Brian Cully <bjc@kublai.com> | 2021-02-19 15:27:22 -0500 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2021-02-19 15:27:22 -0500 |
commit | a5e378e2b4c075f09d3293ccc301f0e504cb20d7 (patch) | |
tree | 5cadc502f422e180ac82030fd98e01692e4268d0 /lethality-selector.mjs | |
parent | ed2b76634a6fb1a9fb45abdd7afc7342f5b6f12c (diff) | |
download | molsim2-a5e378e2b4c075f09d3293ccc301f0e504cb20d7.tar.gz molsim2-a5e378e2b4c075f09d3293ccc301f0e504cb20d7.zip |
Alter rule flow
It’s simpler to put kill/clone buttons on the final step, so kill the
initial clone step.
This is probably more sensible overall. The old, clone first method
was done to simplify the state machine at the time, at the cost of
expected instruction order.
Diffstat (limited to 'lethality-selector.mjs')
-rw-r--r-- | lethality-selector.mjs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lethality-selector.mjs b/lethality-selector.mjs deleted file mode 100644 index 80c3e71..0000000 --- a/lethality-selector.mjs +++ /dev/null @@ -1,35 +0,0 @@ -class LethalitySelector { - constructor(elt) { - this.elt = elt - - for (const elt of this.elt.querySelectorAll('button')) { - elt.addEventListener('click', this.select.bind(this)) - } - } - - attach() { - this.elt.classList.remove('hidden') - } - - detach() { - this.elt.classList.add('hidden') - } - - get onItemSelected() { - if (this._onItemSelected !== undefined) { - return this._onItemSelected - } - return () => {} - } - - set onItemSelected(fn) { - this._onItemSelected = fn - } - - select(evt) { - window.evt = evt - this.onItemSelected(evt.target.id == 'lethal') - } -} - -export default LethalitySelector |