diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-01-26 15:14:38 -0400 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-01-26 15:14:38 -0400 |
| commit | a074fd54107c51c4fcbfedbbf6df6eca539d19d3 (patch) | |
| tree | 4fec08106aa3054c1954c5fa4ade0fb880c5eeb3 /src/data/things/flash/FlashSide.js | |
| parent | 796e4bc1452b918bbf50a2e802b308f6ac20f2c2 (diff) | |
data, yaml: split yaml loading specs into src/data/files
Diffstat (limited to 'src/data/things/flash/FlashSide.js')
| -rw-r--r-- | src/data/things/flash/FlashSide.js | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/data/things/flash/FlashSide.js b/src/data/things/flash/FlashSide.js index 72782bdd..5e2ea3de 100644 --- a/src/data/things/flash/FlashSide.js +++ b/src/data/things/flash/FlashSide.js @@ -1,7 +1,4 @@ -const FLASH_DATA_FILE = 'flashes.yaml'; - import {V} from '#composite'; -import {sortFlashesChronologically} from '#sort'; import Thing from '#thing'; import {exposeConstant} from '#composite/control-flow'; @@ -56,81 +53,4 @@ export class FlashSide extends Thing { referenced: flashSide => flashSide.acts, }, }; - - static [Thing.getYamlLoadingSpec] = ({ - documentModes: {allInOne}, - thingConstructors: {Flash, FlashAct}, - }) => ({ - title: `Process flashes file`, - file: FLASH_DATA_FILE, - - documentMode: allInOne, - documentThing: document => - ('Side' in document - ? FlashSide - : 'Act' in document - ? FlashAct - : Flash), - - connect(results) { - let thing, i; - - for (i = 0; thing = results[i]; i++) { - if (thing.isFlashSide) { - const side = thing; - const acts = []; - - for (i++; thing = results[i]; i++) { - if (thing.isFlashAct) { - const act = thing; - const flashes = []; - - for (i++; thing = results[i]; i++) { - if (thing.isFlash) { - const flash = thing; - - flash.act = act; - flashes.push(flash); - - continue; - } - - i--; - break; - } - - act.side = side; - act.flashes = flashes; - acts.push(act); - - continue; - } - - if (thing.isFlash) { - throw new Error(`Flashes must be under an act`); - } - - i--; - break; - } - - side.acts = acts; - - continue; - } - - if (thing.isFlashAct) { - throw new Error(`Acts must be under a side`); - } - - if (thing.isFlash) { - throw new Error(`Flashes must be under a side and act`); - } - } - }, - - sort({flashData}) { - sortFlashesChronologically(flashData); - }, - }); } |