From a5e378e2b4c075f09d3293ccc301f0e504cb20d7 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Fri, 19 Feb 2021 15:27:22 -0500 Subject: Alter rule flow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- lethality-selector.mjs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 lethality-selector.mjs (limited to 'lethality-selector.mjs') 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 -- cgit v1.2.3