From a074fd54107c51c4fcbfedbbf6df6eca539d19d3 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 26 Jan 2026 15:14:38 -0400 Subject: data, yaml: split yaml loading specs into src/data/files --- src/data/things/flash/FlashSide.js | 80 -------------------------------------- 1 file changed, 80 deletions(-) (limited to 'src/data/things/flash/FlashSide.js') 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); - }, - }); } -- cgit 1.3.0-6-gf8a5