@zthun/romulator-client 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ZMetadataBuilder } from '@zthun/helpful-query';
2
2
  import { firstDefined } from '@zthun/helpful-fn';
3
- import { castArray, omitBy, isUndefined, keyBy, kebabCase, uniq } from 'lodash-es';
3
+ import { castArray, omitBy, isUndefined, keyBy, kebabCase } from 'lodash-es';
4
4
  import { sep, extname, basename } from 'node:path';
5
5
 
6
6
  class ZRomulatorConfigGamesMetadata {
@@ -36,32 +36,6 @@ class ZRomulatorConfigGamesBuilder {
36
36
  }
37
37
  }
38
38
 
39
- class ZRomulatorConfigMediaMetadata {
40
- static all() {
41
- return [
42
- ZRomulatorConfigMediaMetadata.mediaFolder()
43
- ];
44
- }
45
- static mediaFolder() {
46
- return new ZMetadataBuilder().id("media-folder").path("mediaFolder").name("Media Folder").fallback("${HOME}/Games/.media").editable().file().build();
47
- }
48
- }
49
-
50
- class ZRomulatorConfigMediaBuilder {
51
- _media = {};
52
- mediaFolder(folder) {
53
- this._media.mediaFolder = folder;
54
- return this;
55
- }
56
- copy(other) {
57
- this._media = structuredClone(other);
58
- return this;
59
- }
60
- build() {
61
- return structuredClone(this._media);
62
- }
63
- }
64
-
65
39
  /**
66
40
  * Represents a list of known config ids
67
41
  */ var ZRomulatorConfigId = /*#__PURE__*/ function(ZRomulatorConfigId) {
@@ -189,92 +163,279 @@ class ZRomulatorConfigBuilder {
189
163
  }
190
164
  }
191
165
 
192
- /**
193
- * Describes what a specific piece of media represents.
194
- */ var ZRomulatorMediaType = /*#__PURE__*/ function(ZRomulatorMediaType) {
166
+ var ZRomulatorGameMediaType = /*#__PURE__*/ function(ZRomulatorGameMediaType) {
195
167
  /**
196
168
  * A 3d representation of the box art.
197
- */ ZRomulatorMediaType["Game3dBox"] = "3dboxes";
169
+ */ ZRomulatorGameMediaType["Box3d"] = "3dboxes";
198
170
  /**
199
171
  * Back of the game box.
200
- */ ZRomulatorMediaType["GameBackCover"] = "backcovers";
172
+ */ ZRomulatorGameMediaType["BackCover"] = "backcovers";
201
173
  /**
202
174
  * Front of the game box.
203
- */ ZRomulatorMediaType["GameCover"] = "covers";
175
+ */ ZRomulatorGameMediaType["Cover"] = "covers";
204
176
  /**
205
177
  * Fan art.
206
- */ ZRomulatorMediaType["GameFanArt"] = "fanart";
178
+ */ ZRomulatorGameMediaType["FanArt"] = "fanart";
207
179
  /**
208
180
  * Game manual.
209
- */ ZRomulatorMediaType["GameManual"] = "manuals";
181
+ */ ZRomulatorGameMediaType["Manual"] = "manuals";
210
182
  /**
211
183
  * A marquee of a game.
212
- */ ZRomulatorMediaType["GameMarquee"] = "marquees";
184
+ */ ZRomulatorGameMediaType["Marquee"] = "marquees";
213
185
  /**
214
186
  * The cartridge or disc label.
215
- */ ZRomulatorMediaType["GamePhysicalMedia"] = "physicalmedia";
187
+ */ ZRomulatorGameMediaType["PhysicalMedia"] = "physicalmedia";
216
188
  /**
217
189
  * An in game screenshot showcasing gameplay.
218
- */ ZRomulatorMediaType["GameScreenshot"] = "screenshots";
190
+ */ ZRomulatorGameMediaType["Screenshot"] = "screenshots";
219
191
  /**
220
192
  * An in game screenshot of the title screen.
221
- */ ZRomulatorMediaType["GameTitle"] = "titlescreens";
193
+ */ ZRomulatorGameMediaType["Title"] = "titlescreens";
222
194
  /**
223
195
  * A video showcasing the game.
224
- */ ZRomulatorMediaType["GameVideo"] = "videos";
196
+ */ ZRomulatorGameMediaType["Video"] = "videos";
197
+ return ZRomulatorGameMediaType;
198
+ }({});
199
+ /**
200
+ * Media type for a system.
201
+ */ var ZRomulatorSystemMediaType = /*#__PURE__*/ function(ZRomulatorSystemMediaType) {
225
202
  /**
226
203
  * An image of a system's controller.
227
- */ ZRomulatorMediaType["SystemController"] = "controller.png";
204
+ */ ZRomulatorSystemMediaType["Controller"] = "controller.png";
228
205
  /**
229
206
  * A icon for the system.
230
207
  *
231
208
  * These are normally 32x32.
232
- */ ZRomulatorMediaType["SystemIcon"] = "icon.png";
209
+ */ ZRomulatorSystemMediaType["Icon"] = "icon.png";
233
210
  /**
234
211
  * An illustration of the system.
235
- */ ZRomulatorMediaType["SystemIllustration"] = "illustration.png";
212
+ */ ZRomulatorSystemMediaType["Illustration"] = "illustration.png";
236
213
  /**
237
214
  * A picture of the system.
238
215
  *
239
216
  * These are real life looking photos of what
240
217
  * a system looks like.
241
- */ ZRomulatorMediaType["SystemPicture"] = "picture.png";
218
+ */ ZRomulatorSystemMediaType["Picture"] = "picture.png";
219
+ /**
220
+ * A video trailer for the system.
221
+ */ ZRomulatorSystemMediaType["Video"] = "video.mp4";
242
222
  /**
243
223
  * A wheel for a system.
244
224
  *
245
225
  * This is basically the logo.
246
- */ ZRomulatorMediaType["SystemWheel"] = "wheel.png";
247
- return ZRomulatorMediaType;
226
+ */ ZRomulatorSystemMediaType["Wheel"] = "wheel.png";
227
+ return ZRomulatorSystemMediaType;
248
228
  }({});
249
- const ZRomulatorMediaTypeMap = keyBy(Object.values(ZRomulatorMediaType));
229
+ const ZRomulatorSystemMediaTypeMap = keyBy(Object.values(ZRomulatorSystemMediaType));
230
+ const ZRomulatorGameMediaTypeMap = keyBy(Object.values(ZRomulatorGameMediaType));
231
+ function isSystemMediaType(candidate) {
232
+ return typeof candidate === "string" && Object.prototype.hasOwnProperty.call(ZRomulatorSystemMediaTypeMap, candidate);
233
+ }
234
+ function isGameMediaType(candidate) {
235
+ return typeof candidate === "string" && Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate);
236
+ }
250
237
  function isMediaType(candidate) {
251
- return typeof candidate === "string" && Object.prototype.hasOwnProperty.call(ZRomulatorMediaTypeMap, candidate);
238
+ return isSystemMediaType(candidate) || isGameMediaType(candidate);
252
239
  }
253
240
 
254
241
  /**
255
242
  * Id slugs for supported systems.
256
243
  */ var ZRomulatorSystemId = /*#__PURE__*/ function(ZRomulatorSystemId) {
257
- /**
258
- * Nintendo Entertainment System
259
- */ ZRomulatorSystemId["Nintendo"] = "nes";
260
- /**
261
- * Super Nintendo Entertainment System.
262
- */ ZRomulatorSystemId["SuperNintendo"] = "snes";
263
- /**
264
- * Nintendo 64
265
- */ ZRomulatorSystemId["Nintendo64"] = "n64";
266
- /**
267
- * Nintendo GameCube
268
- */ ZRomulatorSystemId["GameCube"] = "gc";
269
- /**
270
- * Nintendo Wii
271
- */ ZRomulatorSystemId["Wii"] = "wii";
272
- /**
273
- * Nintendo Wii U
274
- */ ZRomulatorSystemId["WiiU"] = "wiiu";
275
- /**
276
- * Nintendo Switch
277
- */ ZRomulatorSystemId["Switch"] = "switch";
244
+ ZRomulatorSystemId["ThreeDo"] = "3do";
245
+ ZRomulatorSystemId["Adam"] = "adam";
246
+ ZRomulatorSystemId["AGS"] = "ags";
247
+ ZRomulatorSystemId["Amiga"] = "amiga";
248
+ ZRomulatorSystemId["Amiga1200"] = "amiga1200";
249
+ ZRomulatorSystemId["Amiga600"] = "amiga600";
250
+ ZRomulatorSystemId["AmigaCd32"] = "amigacd32";
251
+ ZRomulatorSystemId["AmstradCpc"] = "amstradcpc";
252
+ ZRomulatorSystemId["Android"] = "android";
253
+ ZRomulatorSystemId["AndroidApps"] = "androidapps";
254
+ ZRomulatorSystemId["AndroidGames"] = "androidgames";
255
+ ZRomulatorSystemId["Apple2"] = "apple2";
256
+ ZRomulatorSystemId["Apple2Gs"] = "apple2gs";
257
+ ZRomulatorSystemId["Arcade"] = "arcade";
258
+ ZRomulatorSystemId["Arcadia"] = "arcadia";
259
+ ZRomulatorSystemId["Archimedes"] = "archimedes";
260
+ ZRomulatorSystemId["Arduboy"] = "arduboy";
261
+ ZRomulatorSystemId["Astrocde"] = "astrocde";
262
+ ZRomulatorSystemId["Atari2600"] = "atari2600";
263
+ ZRomulatorSystemId["Atari5200"] = "atari5200";
264
+ ZRomulatorSystemId["Atari7800"] = "atari7800";
265
+ ZRomulatorSystemId["Atari800"] = "atari800";
266
+ ZRomulatorSystemId["AtariJaguar"] = "atarijaguar";
267
+ ZRomulatorSystemId["AtariJaguarCd"] = "atarijaguarcd";
268
+ ZRomulatorSystemId["AtariLynx"] = "atarilynx";
269
+ ZRomulatorSystemId["AtariSt"] = "atarist";
270
+ ZRomulatorSystemId["AtariXe"] = "atarixe";
271
+ ZRomulatorSystemId["Atomiswave"] = "atomiswave";
272
+ ZRomulatorSystemId["BbcMicro"] = "bbcmicro";
273
+ ZRomulatorSystemId["C64"] = "c64";
274
+ ZRomulatorSystemId["CdiMono1"] = "cdimono1";
275
+ ZRomulatorSystemId["Cdtv"] = "cdtv";
276
+ ZRomulatorSystemId["ChaiLove"] = "chailove";
277
+ ZRomulatorSystemId["ChannelF"] = "channelf";
278
+ ZRomulatorSystemId["Coco"] = "coco";
279
+ ZRomulatorSystemId["Colecovision"] = "colecovision";
280
+ ZRomulatorSystemId["ConsoleArcade"] = "consolearcade";
281
+ ZRomulatorSystemId["Cps"] = "cps";
282
+ ZRomulatorSystemId["Cps1"] = "cps1";
283
+ ZRomulatorSystemId["Cps2"] = "cps2";
284
+ ZRomulatorSystemId["Cps3"] = "cps3";
285
+ ZRomulatorSystemId["CrVision"] = "crvision";
286
+ ZRomulatorSystemId["Daphne"] = "daphne";
287
+ ZRomulatorSystemId["Desktop"] = "desktop";
288
+ ZRomulatorSystemId["Doom"] = "doom";
289
+ ZRomulatorSystemId["Dos"] = "dos";
290
+ ZRomulatorSystemId["Dragon32"] = "dragon32";
291
+ ZRomulatorSystemId["Dreamcast"] = "dreamcast";
292
+ ZRomulatorSystemId["EasyRpg"] = "easyrpg";
293
+ ZRomulatorSystemId["Electron"] = "electron";
294
+ ZRomulatorSystemId["Emulators"] = "emulators";
295
+ ZRomulatorSystemId["Epic"] = "epic";
296
+ ZRomulatorSystemId["Famicom"] = "famicom";
297
+ ZRomulatorSystemId["FBA"] = "fba";
298
+ ZRomulatorSystemId["FBNeo"] = "fbneo";
299
+ ZRomulatorSystemId["FDS"] = "fds";
300
+ ZRomulatorSystemId["Flash"] = "flash";
301
+ ZRomulatorSystemId["FM7"] = "fm7";
302
+ ZRomulatorSystemId["FMTowns"] = "fmtowns";
303
+ ZRomulatorSystemId["FPinball"] = "fpinball";
304
+ ZRomulatorSystemId["Gamate"] = "gamate";
305
+ ZRomulatorSystemId["GameAndWatch"] = "gameandwatch";
306
+ ZRomulatorSystemId["GameCom"] = "gamecom";
307
+ ZRomulatorSystemId["GameGear"] = "gamegear";
308
+ ZRomulatorSystemId["GB"] = "gb";
309
+ ZRomulatorSystemId["GBA"] = "gba";
310
+ ZRomulatorSystemId["GBC"] = "gbc";
311
+ ZRomulatorSystemId["GameCube"] = "gc";
312
+ ZRomulatorSystemId["Genesis"] = "genesis";
313
+ ZRomulatorSystemId["GMaster"] = "gmaster";
314
+ ZRomulatorSystemId["GX4000"] = "gx4000";
315
+ ZRomulatorSystemId["Intellivision"] = "intellivision";
316
+ ZRomulatorSystemId["J2ME"] = "j2me";
317
+ ZRomulatorSystemId["Kodi"] = "kodi";
318
+ ZRomulatorSystemId["Laserdisc"] = "laserdisc";
319
+ ZRomulatorSystemId["LcdGames"] = "lcdgames";
320
+ ZRomulatorSystemId["LowResNx"] = "lowresnx";
321
+ ZRomulatorSystemId["Lutris"] = "lutris";
322
+ ZRomulatorSystemId["Lutro"] = "lutro";
323
+ ZRomulatorSystemId["Macintosh"] = "macintosh";
324
+ ZRomulatorSystemId["Mame"] = "mame";
325
+ ZRomulatorSystemId["MameAdvMame"] = "mame-advmame";
326
+ ZRomulatorSystemId["Mark3"] = "mark3";
327
+ ZRomulatorSystemId["MasterSystem"] = "mastersystem";
328
+ ZRomulatorSystemId["MegaCd"] = "megacd";
329
+ ZRomulatorSystemId["MegaCdJp"] = "megacdjp";
330
+ ZRomulatorSystemId["MegaDrive"] = "megadrive";
331
+ ZRomulatorSystemId["MegaDriveJp"] = "megadrivejp";
332
+ ZRomulatorSystemId["MegaDuck"] = "megaduck";
333
+ ZRomulatorSystemId["MESS"] = "mess";
334
+ ZRomulatorSystemId["Model2"] = "model2";
335
+ ZRomulatorSystemId["Model3"] = "model3";
336
+ ZRomulatorSystemId["Moto"] = "moto";
337
+ ZRomulatorSystemId["MSX"] = "msx";
338
+ ZRomulatorSystemId["MSX1"] = "msx1";
339
+ ZRomulatorSystemId["MSX2"] = "msx2";
340
+ ZRomulatorSystemId["MSXTurbor"] = "msxturbor";
341
+ ZRomulatorSystemId["Mugen"] = "mugen";
342
+ ZRomulatorSystemId["Multivision"] = "multivision";
343
+ ZRomulatorSystemId["N3DS"] = "n3ds";
344
+ ZRomulatorSystemId["Nintendo64"] = "n64";
345
+ ZRomulatorSystemId["N64DD"] = "n64dd";
346
+ ZRomulatorSystemId["Naomi"] = "naomi";
347
+ ZRomulatorSystemId["Naomi2"] = "naomi2";
348
+ ZRomulatorSystemId["NaomiGd"] = "naomigd";
349
+ ZRomulatorSystemId["NDS"] = "nds";
350
+ ZRomulatorSystemId["NeoGeo"] = "neogeo";
351
+ ZRomulatorSystemId["NeoGeoCd"] = "neogeocd";
352
+ ZRomulatorSystemId["NeoGeoCdJp"] = "neogeocdjp";
353
+ ZRomulatorSystemId["Nintendo"] = "nes";
354
+ ZRomulatorSystemId["NGage"] = "ngage";
355
+ ZRomulatorSystemId["NeoGeoPocket"] = "ngp";
356
+ ZRomulatorSystemId["NeoGeoPocketColor"] = "ngpc";
357
+ ZRomulatorSystemId["Odyssey2"] = "odyssey2";
358
+ ZRomulatorSystemId["OpenBor"] = "openbor";
359
+ ZRomulatorSystemId["Oric"] = "oric";
360
+ ZRomulatorSystemId["Palm"] = "palm";
361
+ ZRomulatorSystemId["PC"] = "pc";
362
+ ZRomulatorSystemId["PC88"] = "pc88";
363
+ ZRomulatorSystemId["PC98"] = "pc98";
364
+ ZRomulatorSystemId["PcArcade"] = "pcarcade";
365
+ ZRomulatorSystemId["PcEngine"] = "pcengine";
366
+ ZRomulatorSystemId["PcEngineCd"] = "pcenginecd";
367
+ ZRomulatorSystemId["PCFx"] = "pcfx";
368
+ ZRomulatorSystemId["Pico8"] = "pico8";
369
+ ZRomulatorSystemId["Plus4"] = "plus4";
370
+ ZRomulatorSystemId["PokeMini"] = "pokemini";
371
+ ZRomulatorSystemId["Ports"] = "ports";
372
+ ZRomulatorSystemId["PS2"] = "ps2";
373
+ ZRomulatorSystemId["PS3"] = "ps3";
374
+ ZRomulatorSystemId["PS4"] = "ps4";
375
+ ZRomulatorSystemId["PSP"] = "psp";
376
+ ZRomulatorSystemId["PSVita"] = "psvita";
377
+ ZRomulatorSystemId["PSX"] = "psx";
378
+ ZRomulatorSystemId["PV1000"] = "pv1000";
379
+ ZRomulatorSystemId["Quake"] = "quake";
380
+ ZRomulatorSystemId["SamCoupe"] = "samcoupe";
381
+ ZRomulatorSystemId["Satellaview"] = "satellaview";
382
+ ZRomulatorSystemId["Saturn"] = "saturn";
383
+ ZRomulatorSystemId["SaturnJp"] = "saturnjp";
384
+ ZRomulatorSystemId["ScummVM"] = "scummvm";
385
+ ZRomulatorSystemId["SCV"] = "scv";
386
+ ZRomulatorSystemId["Sega32X"] = "sega32x";
387
+ ZRomulatorSystemId["Sega32XJp"] = "sega32xjp";
388
+ ZRomulatorSystemId["Sega32XNa"] = "sega32xna";
389
+ ZRomulatorSystemId["SegaCd"] = "segacd";
390
+ ZRomulatorSystemId["SFC"] = "sfc";
391
+ ZRomulatorSystemId["Sg1000"] = "sg-1000";
392
+ ZRomulatorSystemId["SGB"] = "sgb";
393
+ ZRomulatorSystemId["SuperNintendo"] = "snes";
394
+ ZRomulatorSystemId["SnesNa"] = "snesna";
395
+ ZRomulatorSystemId["Solarus"] = "solarus";
396
+ ZRomulatorSystemId["SpectraVideo"] = "spectravideo";
397
+ ZRomulatorSystemId["Steam"] = "steam";
398
+ ZRomulatorSystemId["STV"] = "stv";
399
+ ZRomulatorSystemId["Sufami"] = "sufami";
400
+ ZRomulatorSystemId["SuperGrafx"] = "supergrafx";
401
+ ZRomulatorSystemId["SuperVision"] = "supervision";
402
+ ZRomulatorSystemId["SupraCan"] = "supracan";
403
+ ZRomulatorSystemId["Switch"] = "switch";
404
+ ZRomulatorSystemId["Symbian"] = "symbian";
405
+ ZRomulatorSystemId["TanoDragon"] = "tanodragon";
406
+ ZRomulatorSystemId["TgCd"] = "tg-cd";
407
+ ZRomulatorSystemId["TG16"] = "tg16";
408
+ ZRomulatorSystemId["TI99"] = "ti99";
409
+ ZRomulatorSystemId["TIC80"] = "tic80";
410
+ ZRomulatorSystemId["TO8"] = "to8";
411
+ ZRomulatorSystemId["Triforce"] = "triforce";
412
+ ZRomulatorSystemId["TRS80"] = "trs-80";
413
+ ZRomulatorSystemId["TypeX"] = "type-x";
414
+ ZRomulatorSystemId["Uzebox"] = "uzebox";
415
+ ZRomulatorSystemId["Vectrex"] = "vectrex";
416
+ ZRomulatorSystemId["Vic20"] = "vic20";
417
+ ZRomulatorSystemId["VideoPac"] = "videopac";
418
+ ZRomulatorSystemId["Vircon32"] = "vircon32";
419
+ ZRomulatorSystemId["VirtualBoy"] = "virtualboy";
420
+ ZRomulatorSystemId["VPinball"] = "vpinball";
421
+ ZRomulatorSystemId["VSmile"] = "vsmile";
422
+ ZRomulatorSystemId["Wasm4"] = "wasm4";
423
+ ZRomulatorSystemId["Wii"] = "wii";
424
+ ZRomulatorSystemId["WiiU"] = "wiiu";
425
+ ZRomulatorSystemId["Windows"] = "windows";
426
+ ZRomulatorSystemId["Windows3X"] = "windows3x";
427
+ ZRomulatorSystemId["Windows9X"] = "windows9x";
428
+ ZRomulatorSystemId["WonderSwan"] = "wonderswan";
429
+ ZRomulatorSystemId["WonderSwanColor"] = "wonderswancolor";
430
+ ZRomulatorSystemId["X1"] = "x1";
431
+ ZRomulatorSystemId["X68000"] = "x68000";
432
+ ZRomulatorSystemId["Xbox"] = "xbox";
433
+ ZRomulatorSystemId["Xbox360"] = "xbox360";
434
+ ZRomulatorSystemId["XboxOne"] = "xboxone";
435
+ ZRomulatorSystemId["ZMachine"] = "zmachine";
436
+ ZRomulatorSystemId["Zx81"] = "zx81";
437
+ ZRomulatorSystemId["ZxNext"] = "zxnext";
438
+ ZRomulatorSystemId["ZxSpectrum"] = "zxspectrum";
278
439
  return ZRomulatorSystemId;
279
440
  }({});
280
441
  const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
@@ -330,12 +491,12 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
330
491
  builder = builder.filename(fileName);
331
492
  const ext = extname(fileName);
332
493
  const title = basename(fileName, ext);
333
- if (isMediaType(fileName) && isSystemId(parent)) {
494
+ if (isSystemMediaType(fileName) && isSystemId(parent)) {
334
495
  // This is media for system hardware
335
496
  const id = `${parent}-${kebabCase(title)}`;
336
497
  return builder.id(id).system(parent).type(fileName).game(undefined);
337
498
  }
338
- if (fileName && isMediaType(parent) && isSystemId(grandparent)) {
499
+ if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {
339
500
  // This is media for a game that is supported. The id for a game
340
501
  // is the system id followed by the kebab case of the title, followed
341
502
  // by the media type.
@@ -355,17 +516,32 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
355
516
  * Describes a type of system.
356
517
  */ var ZRomulatorSystemType = /*#__PURE__*/ function(ZRomulatorSystemType) {
357
518
  /**
358
- * A console system.
359
- */ ZRomulatorSystemType["Console"] = "console";
360
- /**
361
- * A handheld system
362
- */ ZRomulatorSystemType["Handheld"] = "handheld";
519
+ * An accessory that attaches to another system.
520
+ */ ZRomulatorSystemType["Accessory"] = "accessory";
363
521
  /**
364
522
  * A cabinet system
365
523
  */ ZRomulatorSystemType["Arcade"] = "arcade";
366
524
  /**
367
525
  * Known computer systems
368
526
  */ ZRomulatorSystemType["Computer"] = "computer";
527
+ /**
528
+ * A console system.
529
+ */ ZRomulatorSystemType["Console"] = "console";
530
+ /**
531
+ * Pinball
532
+ */ ZRomulatorSystemType["Flipper"] = "flipper";
533
+ /**
534
+ * A handheld system
535
+ */ ZRomulatorSystemType["Handheld"] = "console-portable";
536
+ /**
537
+ * Script Creation Utility.
538
+ */ ZRomulatorSystemType["ScummVm"] = "scummvm";
539
+ /**
540
+ * Phone based system
541
+ */ ZRomulatorSystemType["Smartphone"] = "smartphone";
542
+ /**
543
+ * Virtual machine based system.
544
+ */ ZRomulatorSystemType["VirtualMachine"] = "virtual-machine";
369
545
  return ZRomulatorSystemType;
370
546
  }({});
371
547
 
@@ -433,32 +609,6 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
433
609
  * This instance.
434
610
  */ computer = this.type.bind(this, ZRomulatorSystemType.Computer);
435
611
  /**
436
- * Sets the aliases of the system.
437
- *
438
- * @param aliases -
439
- * The aliases of the system.
440
- * @returns
441
- * This instance.
442
- */ aliases(aliases) {
443
- this._system.aliases = aliases;
444
- return this;
445
- }
446
- /**
447
- * Adds an alias to the system.
448
- *
449
- * If an alias already exists, then it will
450
- * not be added again.
451
- *
452
- * @param alias -
453
- * The alias to add to the system.
454
- * @returns
455
- * This instance.
456
- */ alias(alias) {
457
- const aliases = firstDefined([], this._system.aliases).slice();
458
- aliases.push(alias);
459
- return this.aliases(uniq(aliases));
460
- }
461
- /**
462
612
  * Sets the generational index of the system.
463
613
  *
464
614
  * @param generation -
@@ -470,29 +620,19 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
470
620
  return this;
471
621
  }
472
622
  /**
473
- * Sets the manufacturers of the system.
474
- *
475
- * @param manufacturers -
476
- * The manufacturers of the system.
477
- * @returns
478
- * This instance.
479
- */ manufacturers(manufacturers) {
480
- this._system.manufacturers = manufacturers;
481
- return this;
482
- }
483
- /**
484
- * Adds a manufacturer for the system.
623
+ * Assigns system data to this system.
485
624
  *
486
- * If a manufacturer already exists, then it will not be added again.
625
+ * @param system -
626
+ * The partial system data to assign.
487
627
  *
488
- * @param manufacturer -
489
- * The manufacturer of the system.
490
628
  * @returns
491
- * This instance.
492
- */ manufacturer(manufacturer) {
493
- const manufacturers = firstDefined([], this._system.manufacturers).slice();
494
- manufacturers.push(manufacturer);
495
- return this.manufacturers(uniq(manufacturers));
629
+ * This object.
630
+ */ assign(system) {
631
+ this._system = {
632
+ ...this._system,
633
+ ...system
634
+ };
635
+ return this;
496
636
  }
497
637
  /**
498
638
  * Builds the system instance.
@@ -505,5 +645,5 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
505
645
  }
506
646
  }
507
647
 
508
- export { ZRomulatorConfigBuilder, ZRomulatorConfigGamesBuilder, ZRomulatorConfigGamesMetadata, ZRomulatorConfigId, ZRomulatorConfigMediaBuilder, ZRomulatorConfigMediaMetadata, ZRomulatorGameBuilder, ZRomulatorMediaBuilder, ZRomulatorMediaType, ZRomulatorSystemBuilder, ZRomulatorSystemId, ZRomulatorSystemType, isMediaType, isSystemId };
648
+ export { ZRomulatorConfigBuilder, ZRomulatorConfigGamesBuilder, ZRomulatorConfigGamesMetadata, ZRomulatorConfigId, ZRomulatorGameBuilder, ZRomulatorGameMediaType, ZRomulatorMediaBuilder, ZRomulatorSystemBuilder, ZRomulatorSystemId, ZRomulatorSystemMediaType, ZRomulatorSystemType, isGameMediaType, isMediaType, isSystemId, isSystemMediaType };
509
649
  //# sourceMappingURL=index.js.map