« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data/things/adventure.js131
-rw-r--r--src/data/things/index.js2
2 files changed, 0 insertions, 133 deletions
diff --git a/src/data/things/adventure.js b/src/data/things/adventure.js
deleted file mode 100644
index 98b23f39..00000000
--- a/src/data/things/adventure.js
+++ /dev/null
@@ -1,131 +0,0 @@
-export const DATA_ADVENTURE_DIRECTORY = 'adventure';
-
-import * as path from 'node:path';
-
-import {input} from '#composite';
-import {traverse} from '#node-utils';
-import Thing from '#thing';
-
-import {exposeDependency} from '#composite/control-flow';
-import {withPropertyFromObject} from '#composite/data';
-import {directory, name, thing, thingList}
-  from '#composite/wiki-properties';
-
-// *thumb-twiddling*
-import {Flash, FlashAct} from './flash.js';
-
-export class Adventure extends Thing {
-  static [Thing.referenceType] = 'adventure';
-  static [Thing.wikiData] = 'adventureData';
-
-  static [Thing.getPropertyDescriptors] = ({FlashAct}) => ({
-    // > Internal relationships
-
-    acts: thingList({
-      class: input.value(FlashAct),
-    }),
-
-    // > Identifying metadata
-
-    name: name('Unnamed Adventure'),
-    directory: directory(),
-  });
-
-  static [Thing.yamlDocumentSpec] = {
-    fields: {
-      // Identifying metadata
-
-      'Adventure': {property: 'name'},
-      'Directory': {property: 'directory'},
-    },
-  };
-
-  static [Thing.getYamlLoadingSpec] = ({
-    documentModes: {headerAndEntries},
-    thingConstructors: {
-      Adventure,
-      AdventureFlashAct,
-      AdventureFlash,
-    },
-  }) => ({
-    title: `Process adventure files`,
-
-    files: dataPath =>
-      traverse(path.join(dataPath, DATA_ADVENTURE_DIRECTORY), {
-        filterFile: name => path.extname(name) === '.yaml',
-        prefixPath: DATA_ADVENTURE_DIRECTORY,
-      }),
-
-    documentMode: headerAndEntries,
-
-    headerDocumentThing: Adventure,
-    entryDocumentThing: document =>
-      ('Act' in document
-        ? AdventureFlashAct
-        : AdventureFlash),
-
-    connect({header: adventure, entries}) {
-      const acts = [];
-
-      let thing, i;
-      for (i = 0; thing = entries[i]; i++) {
-        if (thing.isFlashAct) {
-          const act = thing;
-          const flashes = [];
-
-          for (i++; thing = entries[i]; i++) {
-            if (thing.isFlash) {
-              const flash = thing;
-
-              flash.act = act;
-              flashes.push(flash);
-
-              continue;
-            }
-
-            i--;
-            break;
-          }
-
-          act.flashes = flashes;
-          acts.push(act);
-
-          continue;
-        }
-
-        if (thing.isFlash) {
-          throw new Error(`Flashes must be under a flash act`);
-        }
-      }
-
-      adventure.acts = acts;
-    },
-  });
-}
-
-export class AdventureFlash extends Flash {
-  static [Thing.getPropertyDescriptors] = ({Adventure}) => ({
-    // > Implicit relationships
-
-    adventure: [
-      withPropertyFromObject({
-        object: 'act',
-        property: input.value('adventure'),
-      }),
-
-      exposeDependency({
-        dependency: '#act.adventure',
-      }),
-    ],
-  });
-}
-
-export class AdventureFlashAct extends FlashAct {
-  static [Thing.getPropertyDescriptors] = ({Adventure}) => ({
-    // > Internal relationships
-
-    adventure: thing({
-      class: input.value(Adventure),
-    }),
-  });
-}
diff --git a/src/data/things/index.js b/src/data/things/index.js
index 893684de..1e9a5e52 100644
--- a/src/data/things/index.js
+++ b/src/data/things/index.js
@@ -11,7 +11,6 @@ import Thing from '#thing';
 
 import * as additionalFileClasses from './additional-file.js';
 import * as additionalNameClasses from './additional-name.js';
-import * as adventureClasses from './adventure.js';
 import * as albumClasses from './album.js';
 import * as artTagClasses from './art-tag.js';
 import * as artistClasses from './artist.js';
@@ -31,7 +30,6 @@ import * as wikiInfoClasses from './wiki-info.js';
 const allClassLists = {
   'additional-file.js': additionalFileClasses,
   'additional-name.js': additionalNameClasses,
-  'adventure.js': adventureClasses,
   'album.js': albumClasses,
   'art-tag.js': artTagClasses,
   'artist.js': artistClasses,