dyo-tools 0.4.0 → 0.4.1

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.
Files changed (157) hide show
  1. package/{dist/index.d.ts → index.d.ts} +1 -0
  2. package/{dist/index.d.ts.map → index.d.ts.map} +1 -1
  3. package/{dist/index.js → index.js} +1 -0
  4. package/package.json +6 -56
  5. package/.c8rc.json +0 -4
  6. package/.eslintignore +0 -2
  7. package/.eslintrc.json +0 -47
  8. package/Makefile +0 -34
  9. package/README.md +0 -0
  10. package/babel.config.js +0 -1
  11. package/docs/.nojekyll +0 -1
  12. package/docs/assets/highlight.css +0 -29
  13. package/docs/assets/main.js +0 -59
  14. package/docs/assets/search.js +0 -1
  15. package/docs/assets/style.css +0 -1414
  16. package/docs/index.html +0 -1
  17. package/integration/data/components/DTHero.ts +0 -42
  18. package/integration/data/components/DTHeroManager.ts +0 -11
  19. package/integration/data/components/DTHeroPlayZone.ts +0 -6
  20. package/integration/data/components/DTHeroPlayerHand.ts +0 -11
  21. package/integration/data/components/index.ts +0 -5
  22. package/integration/data/in/heroIn.helper.ts +0 -8
  23. package/integration/data/in/playerIn.helper.ts +0 -13
  24. package/integration/data/out/heroOut.helper.ts +0 -48
  25. package/integration/endings/synchronisation.ending.ts +0 -25
  26. package/integration/scenes/drawCard.scene.ts +0 -31
  27. package/integration/scenes/empty.scene.ts +0 -6
  28. package/integration/scenes/playCard.scene.ts +0 -23
  29. package/integration/scenes/playerLeave.scene.ts +0 -33
  30. package/integration/stages/baseDix.stage.ts +0 -137
  31. package/integration/stages/syncDix.stage.ts +0 -36
  32. package/integration/tests/scenario1.spec.ts +0 -55
  33. package/integration/types/index.ts +0 -24
  34. package/jest-integration.config.ts +0 -25
  35. package/jest.config.ts +0 -26
  36. package/src/constants.ts +0 -87
  37. package/src/core/DTAction.ts +0 -54
  38. package/src/core/DTBunch.ts +0 -531
  39. package/src/core/DTComponent.ts +0 -258
  40. package/src/core/DTComponentPhysical.ts +0 -88
  41. package/src/core/DTComponentWithMeta.ts +0 -98
  42. package/src/core/DTElement.ts +0 -111
  43. package/src/core/DTError.ts +0 -78
  44. package/src/core/DTManager.ts +0 -555
  45. package/src/core/DTMaster.ts +0 -366
  46. package/src/core/DTModule.ts +0 -96
  47. package/src/index.ts +0 -17
  48. package/src/libs/DYOFinder.ts +0 -175
  49. package/src/libs/dix/DIXModule.module.ts +0 -98
  50. package/src/libs/player/DTPlayer.element.ts +0 -9
  51. package/src/libs/player/DTPlayer.manager.ts +0 -70
  52. package/src/types/core.ts +0 -204
  53. package/src/types/index.ts +0 -2
  54. package/src/types/player.ts +0 -5
  55. package/test/core/DTAction.double.ts +0 -62
  56. package/test/core/DTAction.spec.ts +0 -68
  57. package/test/core/DTBunch.double.ts +0 -175
  58. package/test/core/DTBunch.spec.ts +0 -822
  59. package/test/core/DTComponent.double.ts +0 -179
  60. package/test/core/DTComponent.spec.ts +0 -297
  61. package/test/core/DTComponentPhysical.double.ts +0 -62
  62. package/test/core/DTComponentPhysical.spec.ts +0 -81
  63. package/test/core/DTComponentWithMeta.double.ts +0 -122
  64. package/test/core/DTComponentWithMeta.spec.ts +0 -129
  65. package/test/core/DTElement.double.ts +0 -142
  66. package/test/core/DTElement.spec.ts +0 -123
  67. package/test/core/DTError.double.ts +0 -57
  68. package/test/core/DTError.spec.ts +0 -78
  69. package/test/core/DTManager.double.ts +0 -149
  70. package/test/core/DTManager.spec.ts +0 -874
  71. package/test/core/DTMaster.double.ts +0 -117
  72. package/test/core/DTMaster.spec.ts +0 -537
  73. package/test/core/DTModule.double.ts +0 -67
  74. package/test/core/DTModule.spec.ts +0 -124
  75. package/test/core/copy.spec.ts +0 -222
  76. package/test/libs/DYOFinder.double.ts +0 -152
  77. package/test/libs/DYOFinder.spec.ts +0 -194
  78. package/test/libs/player/DTPlayer.element.double.ts +0 -55
  79. package/test/libs/player/DTPlayer.element.spec.ts +0 -28
  80. package/test/libs/player/DTPlayer.manager.double.ts +0 -92
  81. package/test/libs/player/DTPlayer.manager.spec.ts +0 -178
  82. package/tsconfig.dev.json +0 -19
  83. package/tsconfig.json +0 -18
  84. /package/{dist/constants.d.ts → constants.d.ts} +0 -0
  85. /package/{dist/constants.d.ts.map → constants.d.ts.map} +0 -0
  86. /package/{dist/constants.js → constants.js} +0 -0
  87. /package/{dist/constants.js.map → constants.js.map} +0 -0
  88. /package/{dist/core → core}/DTAction.d.ts +0 -0
  89. /package/{dist/core → core}/DTAction.d.ts.map +0 -0
  90. /package/{dist/core → core}/DTAction.js +0 -0
  91. /package/{dist/core → core}/DTAction.js.map +0 -0
  92. /package/{dist/core → core}/DTBunch.d.ts +0 -0
  93. /package/{dist/core → core}/DTBunch.d.ts.map +0 -0
  94. /package/{dist/core → core}/DTBunch.js +0 -0
  95. /package/{dist/core → core}/DTBunch.js.map +0 -0
  96. /package/{dist/core → core}/DTComponent.d.ts +0 -0
  97. /package/{dist/core → core}/DTComponent.d.ts.map +0 -0
  98. /package/{dist/core → core}/DTComponent.js +0 -0
  99. /package/{dist/core → core}/DTComponent.js.map +0 -0
  100. /package/{dist/core → core}/DTComponentPhysical.d.ts +0 -0
  101. /package/{dist/core → core}/DTComponentPhysical.d.ts.map +0 -0
  102. /package/{dist/core → core}/DTComponentPhysical.js +0 -0
  103. /package/{dist/core → core}/DTComponentPhysical.js.map +0 -0
  104. /package/{dist/core → core}/DTComponentWithMeta.d.ts +0 -0
  105. /package/{dist/core → core}/DTComponentWithMeta.d.ts.map +0 -0
  106. /package/{dist/core → core}/DTComponentWithMeta.js +0 -0
  107. /package/{dist/core → core}/DTComponentWithMeta.js.map +0 -0
  108. /package/{dist/core → core}/DTElement.d.ts +0 -0
  109. /package/{dist/core → core}/DTElement.d.ts.map +0 -0
  110. /package/{dist/core → core}/DTElement.js +0 -0
  111. /package/{dist/core → core}/DTElement.js.map +0 -0
  112. /package/{dist/core → core}/DTError.d.ts +0 -0
  113. /package/{dist/core → core}/DTError.d.ts.map +0 -0
  114. /package/{dist/core → core}/DTError.js +0 -0
  115. /package/{dist/core → core}/DTError.js.map +0 -0
  116. /package/{dist/core → core}/DTManager.d.ts +0 -0
  117. /package/{dist/core → core}/DTManager.d.ts.map +0 -0
  118. /package/{dist/core → core}/DTManager.js +0 -0
  119. /package/{dist/core → core}/DTManager.js.map +0 -0
  120. /package/{dist/core → core}/DTMaster.d.ts +0 -0
  121. /package/{dist/core → core}/DTMaster.d.ts.map +0 -0
  122. /package/{dist/core → core}/DTMaster.js +0 -0
  123. /package/{dist/core → core}/DTMaster.js.map +0 -0
  124. /package/{dist/core → core}/DTModule.d.ts +0 -0
  125. /package/{dist/core → core}/DTModule.d.ts.map +0 -0
  126. /package/{dist/core → core}/DTModule.js +0 -0
  127. /package/{dist/core → core}/DTModule.js.map +0 -0
  128. /package/{dist/index.js.map → index.js.map} +0 -0
  129. /package/{dist/libs → libs}/DYOFinder.d.ts +0 -0
  130. /package/{dist/libs → libs}/DYOFinder.d.ts.map +0 -0
  131. /package/{dist/libs → libs}/DYOFinder.js +0 -0
  132. /package/{dist/libs → libs}/DYOFinder.js.map +0 -0
  133. /package/{dist/libs → libs}/dix/DIXModule.module.d.ts +0 -0
  134. /package/{dist/libs → libs}/dix/DIXModule.module.d.ts.map +0 -0
  135. /package/{dist/libs → libs}/dix/DIXModule.module.js +0 -0
  136. /package/{dist/libs → libs}/player/DTPlayer.element.d.ts +0 -0
  137. /package/{dist/libs → libs}/player/DTPlayer.element.d.ts.map +0 -0
  138. /package/{dist/libs → libs}/player/DTPlayer.element.js +0 -0
  139. /package/{dist/libs → libs}/player/DTPlayer.element.js.map +0 -0
  140. /package/{dist/libs → libs}/player/DTPlayer.manager.d.ts +0 -0
  141. /package/{dist/libs → libs}/player/DTPlayer.manager.d.ts.map +0 -0
  142. /package/{dist/libs → libs}/player/DTPlayer.manager.js +0 -0
  143. /package/{dist/libs → libs}/player/DTPlayer.manager.js.map +0 -0
  144. /package/{dist/tsconfig.dev.tsbuildinfo → tsconfig.dev.tsbuildinfo} +0 -0
  145. /package/{dist/tsconfig.tsbuildinfo → tsconfig.tsbuildinfo} +0 -0
  146. /package/{dist/types → types}/core.d.ts +0 -0
  147. /package/{dist/types → types}/core.d.ts.map +0 -0
  148. /package/{dist/types → types}/core.js +0 -0
  149. /package/{dist/types → types}/core.js.map +0 -0
  150. /package/{dist/types → types}/index.d.ts +0 -0
  151. /package/{dist/types → types}/index.d.ts.map +0 -0
  152. /package/{dist/types → types}/index.js +0 -0
  153. /package/{dist/types → types}/index.js.map +0 -0
  154. /package/{dist/types → types}/player.d.ts +0 -0
  155. /package/{dist/types → types}/player.d.ts.map +0 -0
  156. /package/{dist/types → types}/player.js +0 -0
  157. /package/{dist/types → types}/player.js.map +0 -0
package/docs/index.html DELETED
@@ -1 +0,0 @@
1
- <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>dyo-tools</title><meta name="description" content="Documentation for dyo-tools"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">dyo-tools</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h2>dyo-tools</h2></div><div class="tsd-panel tsd-typography"></div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="index.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1"></use></svg><span>dyo-tools</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base="."><li><a href="modules/constants.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>constants</a></li><details class="tsd-index-accordion" data-key="core"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg><span>core</span></summary><div class="tsd-accordion-details"><ul class="tsd-nested-navigation"><li><a href="modules/core_DTAction.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTAction</a></li><li><a href="modules/core_DTBunch.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTBunch</a></li><li><a href="modules/core_DTComponent.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTComponent</a></li><li><a href="modules/core_DTComponentPhysical.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTComponentPhysical</a></li><li><a href="modules/core_DTComponentWithMeta.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTComponentWithMeta</a></li><li><a href="modules/core_DTElement.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTElement</a></li><li><a href="modules/core_DTError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTError</a></li><li><a href="modules/core_DTManager.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTManager</a></li><li><a href="modules/core_DTMaster.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTMaster</a></li><li><a href="modules/core_DTModule.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTModule</a></li></ul></div></details><details class="tsd-index-accordion" data-key="libs"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg><span>libs</span></summary><div class="tsd-accordion-details"><ul class="tsd-nested-navigation"><li><a href="modules/libs_DYOFinder.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DYOFinder</a></li><details class="tsd-index-accordion" data-key="libs$player"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg><span>player</span></summary><div class="tsd-accordion-details"><ul class="tsd-nested-navigation"><li><a href="modules/libs_player_DTPlayer_element.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTPlayer.element</a></li><li><a href="modules/libs_player_DTPlayer_manager.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>DTPlayer.manager</a></li></ul></div></details></ul></div></details><li><a href="modules/types.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2"></use></svg>types</a></li></ul></nav></div></div></div><div class="tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><svg style="display: none"><g id="icon-1"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-2"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g><g id="icon-8"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.45 16V7.24H14.49V8.224H10.518V10.936H14.07V11.908H10.518V15.016H14.49V16H9.45Z" fill="var(--color-text)"></path></g><g id="icon-16"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-32"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z" fill="var(--color-text)"></path></g><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g><g id="icon-512"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g><g id="icon-4096"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g><g id="icon-8192"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-16384"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g><g id="icon-32768"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g><g id="icon-65536"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-131072"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-262144"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-524288"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-1048576"><rect fill="var(--color-icon-background)" stroke="#FF4D4D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M8.85 16L11.13 7.24H12.582L14.85 16H13.758L13.182 13.672H10.53L9.954 16H8.85ZM10.746 12.76H12.954L12.282 10.06C12.154 9.548 12.054 9.12 11.982 8.776C11.91 8.432 11.866 8.208 11.85 8.104C11.834 8.208 11.79 8.432 11.718 8.776C11.646 9.12 11.546 9.544 11.418 10.048L10.746 12.76Z" fill="var(--color-text)"></path></g><g id="icon-2097152"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="#FF4D82" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M10.354 17V8.24H13.066C13.586 8.24 14.042 8.348 14.434 8.564C14.826 8.772 15.13 9.064 15.346 9.44C15.562 9.816 15.67 10.256 15.67 10.76C15.67 11.352 15.514 11.86 15.202 12.284C14.898 12.708 14.482 13 13.954 13.16L15.79 17H14.518L12.838 13.28H11.434V17H10.354ZM11.434 12.308H13.066C13.514 12.308 13.874 12.168 14.146 11.888C14.418 11.6 14.554 11.224 14.554 10.76C14.554 10.288 14.418 9.912 14.146 9.632C13.874 9.352 13.514 9.212 13.066 9.212H11.434V12.308Z" fill="var(--color-text)"></path></g><g id="icon-chevronDown"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></g><g id="icon-chevronSmall"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></g><g id="icon-menu"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></g><g id="icon-search"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></g><g id="icon-anchor"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g></svg></body></html>
@@ -1,42 +0,0 @@
1
- import {DTElement} from "../../../src";
2
- import {DIXObject, DTComponentOptions} from "../../../src/types";
3
-
4
- type DTHeroMeta = {
5
- damage: number;
6
- }
7
-
8
- export default class DTHero extends DTElement<DTHeroMeta> {
9
- _domain = 'hero';
10
- name: string;
11
-
12
- constructor(key?: string, options: Partial<DTComponentOptions> = {}) {
13
- super(key, options);
14
- this.name = "";
15
- this.setMeta('damage', 0);
16
- }
17
-
18
- getDamage(): number {
19
- return this.getMeta('damage');
20
- }
21
-
22
- setDamage(damage: number) {
23
- this.setMeta('damage', damage);
24
- }
25
-
26
- toDIXObject(): Record<string, DIXObject> {
27
- const dixObject = super.toDIXObject()[this.getId()];
28
- dixObject.name = this.name;
29
- return {
30
- [this.getId()]: dixObject
31
- };
32
- }
33
-
34
- updateFromDix(dix: Record<string, DIXObject>) {
35
- super.updateFromDix(dix);
36
- const dixObject = dix[this._id];
37
-
38
- if (dixObject && dixObject.owner) {
39
- this.name = dixObject.name as string;
40
- }
41
- }
42
- }
@@ -1,11 +0,0 @@
1
- import {DTManager} from "../../../src";
2
- import DTHero from "./DTHero";
3
- import {DTManagerOptions} from "../../../src/types";
4
-
5
- export default class DTHeroManager extends DTManager<DTHero> {
6
- _domain = 'hero';
7
-
8
- constructor(key?: string, elements: DTHero[] = [], scopes: string[] = [], options: Partial<DTManagerOptions> = {}) {
9
- super(key ?? 'hero', elements, ['hand', 'playZone', ...scopes], options);
10
- }
11
- }
@@ -1,6 +0,0 @@
1
- import {DTBunch} from "../../../src";
2
- import DTHero from "./DTHero";
3
-
4
- export default class DTHeroPlayZone extends DTBunch<DTHero> {
5
- _domain = 'hero';
6
- }
@@ -1,11 +0,0 @@
1
- import {DTBunch} from "../../../src";
2
- import DTHero from "./DTHero";
3
- import {DTBunchOptions} from "../../../src/types";
4
-
5
- export default class DTHeroPlayerHand extends DTBunch<DTHero> {
6
- _domain = 'hero';
7
-
8
- constructor(key?: string, items: DTHero[] = [], options: Partial<DTBunchOptions> = {}) {
9
- super(key, items, { ...options, inheritOwner: true });
10
- }
11
- }
@@ -1,5 +0,0 @@
1
-
2
- export { default as DTHeroManager } from "./DTHeroManager";
3
- export { default as DTHero } from "./DTHero";
4
- export { default as DTHeroPlayerHand } from "./DTHeroPlayerHand";
5
- export { default as DTHeroPlayZone } from "./DTHeroPlayZone";
@@ -1,8 +0,0 @@
1
- import DTHero from "../components/DTHero";
2
-
3
- export function generateHeroElement(key: string, name: string, damage: number): DTHero {
4
- const hero = new DTHero(key);
5
- hero.name = name;
6
- hero.setDamage(damage);
7
- return hero;
8
- }
@@ -1,13 +0,0 @@
1
- import {DTPlayer} from "../../../src";
2
-
3
- export function generatePlayers(count: number): DTPlayer[] {
4
- const playerNames = ['LLHOONN','PRIAM','AXELLE','PAYNHOPES','MORGANE'];
5
- const players: DTPlayer[] = [];
6
- for (let i = 0; i < count; i++) {
7
- if (playerNames[i]) {
8
- players.push(new DTPlayer(playerNames[i]));
9
- }
10
- }
11
-
12
- return players;
13
- }
@@ -1,48 +0,0 @@
1
- import {DIXObject, DTBunchOptions} from "../../../src/types";
2
- import {bunchDefaultOptions} from "../../../src/constants";
3
-
4
- export function dixOutDTHero(key: string, name: string, damage: number, owner: string): DIXObject & { name: string } {
5
- return {
6
- useClass: 'DTHero',
7
- componentType: 'element',
8
- options: JSON.stringify({ errors: false }),
9
- key,
10
- meta: JSON.stringify({ damage }),
11
- owner,
12
- name,
13
- }
14
- }
15
-
16
- export function dixOutDTHeroBunch(useClass: string, key: string, items: string[], owner?: string, options: Partial<DTBunchOptions> = {}): DIXObject {
17
- const outputOptionsDix: DTBunchOptions = { ...bunchDefaultOptions, ...options };
18
- delete outputOptionsDix.syncId;
19
-
20
- const outputDix: DIXObject = {
21
- useClass,
22
- componentType: 'bunch',
23
- key,
24
- items,
25
- options: JSON.stringify(outputOptionsDix),
26
- }
27
-
28
- if (owner) {
29
- outputDix.owner = owner;
30
- }
31
-
32
- return outputDix;
33
- }
34
-
35
- export function dixOutDTHeroManager(key: string, items: string[], library: string): DIXObject {
36
- return {
37
- useClass: 'DTHeroManager',
38
- componentType: 'manager',
39
- options: JSON.stringify({ errors: false, libraryDeletion: false }),
40
- key,
41
- items,
42
- library,
43
- scopes: ['hand', 'playZone']
44
- }
45
- }
46
-
47
-
48
-
@@ -1,25 +0,0 @@
1
- import {DTMaster} from "../../src";
2
- import {IEnding, IStage, IStageExit} from "../types";
3
- import DTDIXModule from "../../src/libs/dix/DIXModule.module";
4
- import * as DIXOverrides from "../data/components";
5
-
6
- export default class SynchronizationEnding implements IEnding {
7
- exit(stage: IStage): IStageExit {
8
- // create a new Master and update From previous DIX
9
- const { master, outDIX, expectedDIX } = stage.exit(true);
10
-
11
- const newMaster = new DTMaster(master.getKey(), { syncId: master.getId() });
12
- const dixModule = new DTDIXModule(DIXOverrides);
13
- newMaster.addModule(dixModule);
14
-
15
- newMaster.updateFromDix(outDIX);
16
- // console.log(newMaster.toDIXObject());
17
-
18
- return {
19
- master: newMaster,
20
- outDIX: newMaster.toDIXObject(),
21
- expectedDIX,
22
- }
23
- }
24
-
25
- }
@@ -1,31 +0,0 @@
1
- import {IScene, IStage} from "../types";
2
- import {generateHeroElement} from "../data/in/heroIn.helper";
3
- import {dixOutDTHero} from "../data/out/heroOut.helper";
4
- import {DTHero} from "../data/components";
5
-
6
- export default class DrawCardScene implements IScene {
7
- play(stage: IStage): void {
8
-
9
- // Each player play draw a new Card from nowhere, which increase HAILEI damage
10
- const heroManager = stage.master.getManager('hero');
11
- if (heroManager) {
12
- const hands = heroManager.getAll('hand');
13
-
14
- hands.forEach(h => {
15
- const newCard = generateHeroElement('HENEKET', 'HENEKET', 5);
16
- h.add(newCard);
17
-
18
- const haileiCard = h.find({ key: { $eq: 'HAILEI' }});
19
- if (haileiCard[0]) {
20
- const haileiCardTyped = haileiCard[0] as DTHero;
21
- haileiCardTyped.setMeta('damage', 10);
22
- stage.dixExit[haileiCardTyped.getId()] = dixOutDTHero(haileiCardTyped.getKey(), haileiCardTyped.name, 10, h.getOwner());
23
- }
24
-
25
- stage.dixExit[h.getId()].items.push(newCard.getId());
26
- stage.dixExit[heroManager.getLibrary().getId()].items.push(newCard.getId());
27
- stage.dixExit[newCard.getId()] = dixOutDTHero(newCard.getKey(), newCard.name, newCard.getDamage(), h.getOwner());
28
- });
29
- }
30
- }
31
- }
@@ -1,6 +0,0 @@
1
- import {IScene, IStage} from "../types";
2
-
3
- export default class EmptyScene implements IScene {
4
- play(stage: IStage): void {
5
- }
6
- }
@@ -1,23 +0,0 @@
1
- import {IScene, IStage} from "../types";
2
-
3
- export default class PlayCardScene implements IScene {
4
- play(stage: IStage): void {
5
-
6
- // Each player play first hand Card
7
- const heroManager = stage.master.getManager('hero');
8
- if (heroManager) {
9
- const hands = heroManager.getAll('hand');
10
- const playZone = heroManager.getAll('playZone');
11
-
12
- hands.forEach(h => {
13
- const cardToPlay = h.get(0);
14
- if (cardToPlay && playZone[0]) {
15
- playZone[0].add(cardToPlay);
16
-
17
- stage.dixExit[playZone[0].getId()].items.push(cardToPlay.getId());
18
- stage.dixExit[h.getId()].items = stage.dixExit[h.getId()].items.slice(1);
19
- }
20
- });
21
- }
22
- }
23
- }
@@ -1,33 +0,0 @@
1
- import {IScene, IStage} from "../types";
2
- import {DTPlayerManager} from "../../src";
3
-
4
- export default class PlayerLeaveScene implements IScene {
5
- play(stage: IStage): void {
6
-
7
- // A player leave the game
8
- // Remove player, hand and all cards from the hand (including Library)
9
- const playerManager = stage.master.getManager('player') as DTPlayerManager;
10
- const heroManager = stage.master.getManager('hero');
11
- const leftPlayer = playerManager?.getLibrary()?.find({ key: { $eq: 'PAYNHOPES' }})[0];
12
- const leftPlayerHand = heroManager?.find({ owner: { $eq: leftPlayer?.getId() } })[0];
13
-
14
- if (leftPlayer && leftPlayerHand && leftPlayerHand.getKey() === 'hand') {
15
- playerManager.removePlayer(leftPlayer.getId());
16
- heroManager.removeMany([ leftPlayerHand.getId() ], { libraryDeletion: true });
17
-
18
- stage.dixExit[playerManager.getLibrary().getId()].items = stage.dixExit[playerManager.getLibrary().getId()]
19
- .items.filter((i) => i !== leftPlayer.getId())
20
- delete stage.dixExit[leftPlayer.getId()];
21
-
22
- stage.dixExit[heroManager.getId()].items = stage.dixExit[heroManager.getId()]
23
- .items.filter((i) => i !== leftPlayerHand.getId());
24
- delete stage.dixExit[leftPlayerHand.getId()];
25
-
26
- leftPlayerHand.getAll().forEach((c) => {
27
- stage.dixExit[heroManager.getLibrary().getId()].items = stage.dixExit[heroManager.getLibrary().getId()]
28
- .items.filter((i) => i !== c.getId());
29
- delete stage.dixExit[c.getId()];
30
- });
31
- }
32
- }
33
- }
@@ -1,137 +0,0 @@
1
- import {DTMaster, DTPlayerManager} from "../../src";
2
- import {generatePlayers} from "../data/in/playerIn.helper";
3
- import DTHeroManager from "../data/components/DTHeroManager";
4
- import DTHero from "../data/components/DTHero";
5
- import {generateHeroElement} from "../data/in/heroIn.helper";
6
- import DTHeroPlayZone from "../data/components/DTHeroPlayZone";
7
- import DTHeroPlayerHand from "../data/components/DTHeroPlayerHand";
8
- import {DIXObject} from "../../src/types";
9
- import {dixOutDTHero, dixOutDTHeroBunch, dixOutDTHeroManager} from "../data/out/heroOut.helper";
10
- import {IEnding, IScene, IStage, IStageExit} from "../types";
11
- import DTDIXModule from "../../src/libs/dix/DIXModule.module";
12
- import * as DIXOverrides from "../data/components";
13
-
14
- export default class BaseDixStage implements IStage {
15
- master: DTMaster;
16
- dixExit: Record<string, DIXObject> = {};
17
-
18
- constructor(private scene: IScene, private ending?: IEnding) {
19
- this.master = new DTMaster('dix');
20
- }
21
-
22
- createMaster(key: string, syncId?: string): DTMaster {
23
- const master = new DTMaster(key, { syncId: syncId });
24
-
25
- // Initialize Module
26
- const dixModule = new DTDIXModule(DIXOverrides);
27
- master.addModule(dixModule);
28
-
29
- return master;
30
- }
31
-
32
- enter() {
33
- this.master = this.createMaster('dyo-test');
34
-
35
- // - Manager player (4 players)
36
- const playerManager = new DTPlayerManager('player');
37
-
38
- const playerIds: string[] = [];
39
- generatePlayers(4).forEach((player) => {
40
- playerManager.addPlayer(player);
41
- this.dixExit[player.getId()] = {
42
- useClass: 'DTPlayer',
43
- componentType: 'element',
44
- options: JSON.stringify({ errors: false }),
45
- key: player.getKey()
46
- };
47
- playerIds.push(player.getId());
48
- });
49
- this.master.addManager(playerManager);
50
- this.dixExit[playerManager.getId()] = {
51
- useClass: 'DTPlayerManager',
52
- componentType: 'manager',
53
- options: JSON.stringify({ errors: false, libraryDeletion: false }),
54
- key: 'player',
55
- items: [],
56
- library: playerManager.getLibrary().getId(),
57
- }
58
- this.dixExit[playerManager.getLibrary().getId()] = {
59
- useClass: 'DTBunch',
60
- key: 'library',
61
- componentType: 'bunch',
62
- options: "",
63
- items: playerIds,
64
- }
65
-
66
- // - Manager : Hero
67
- const heroManager = new DTHeroManager();
68
-
69
- const bunchesIds: Record<string, string[]> = {};
70
- playerManager.findPlayers({owner: undefined}).forEach((player) => {
71
- // -- Hero Elements
72
- const elems: DTHero[] = [
73
- generateHeroElement('HAILEI', 'HAILEI', 7),
74
- generateHeroElement('MELDRINE', 'MELDRINE', 9),
75
- generateHeroElement('MAYDENA', 'MAYDENA', 5),
76
- generateHeroElement('ILDRESS', 'ILDRESS', 3),
77
- generateHeroElement('YSSALIA', 'YSSALIA', 6),
78
- ]
79
-
80
- const hand = new DTHeroPlayerHand('hand', elems);
81
- hand.setOwner(player.getId());
82
-
83
- elems.forEach(e => {
84
- this.dixExit[e.getId()] = dixOutDTHero(e.getKey(), e.name, e.getDamage(), player.getId());
85
- })
86
-
87
- heroManager.add(hand, 'hand');
88
- this.dixExit[hand.getId()] = {
89
- ...dixOutDTHeroBunch('DTHeroPlayerHand','hand', [...elems.map(e => e.getId())], player.getId(), { inheritOwner: true }),
90
- scope: 'hand',
91
- }
92
-
93
- bunchesIds[hand.getId()] = [...elems.map(e => e.getId())];
94
- });
95
-
96
- const playZone = new DTHeroPlayZone('playZone');
97
- heroManager.add(playZone, 'playZone');
98
- this.dixExit[playZone.getId()] = {
99
- ...dixOutDTHeroBunch('DTHeroPlayZone', 'playZone', []),
100
- scope: 'playZone',
101
- };
102
-
103
- this.master.addManager(heroManager);
104
- this.dixExit[heroManager.getId()] = dixOutDTHeroManager('hero', [...Object.keys(bunchesIds), playZone.getId()], heroManager.getLibrary().getId());
105
- this.dixExit[heroManager.getLibrary().getId()] = {
106
- useClass: 'DTBunch',
107
- key: 'library',
108
- componentType: 'bunch',
109
- options: "",
110
- items: Object.values(bunchesIds).reduce((prev, cur) => [...prev, ...cur], []),
111
- }
112
-
113
- this.dixExit[this.master.getId()] = {
114
- useClass: 'DTMaster',
115
- key: 'dyo-test',
116
- componentType: 'master',
117
- options: JSON.stringify({ errors: false }),
118
- items: [playerManager.getId(), heroManager.getId()]
119
- }
120
- }
121
-
122
- play(): void {
123
- this.scene.play(this);
124
- }
125
-
126
- exit(skipEnding: boolean = false): IStageExit {
127
- if (this.ending && !skipEnding) {
128
- return this.ending.exit(this);
129
- }
130
-
131
- return {
132
- master: this.master,
133
- outDIX: this.master.toDIXObject(),
134
- expectedDIX: this.dixExit,
135
- };
136
- }
137
- }
@@ -1,36 +0,0 @@
1
- import BaseDixStage from "./baseDix.stage";
2
- import {DTMaster} from "../../src";
3
- import {IStageExit} from "../types";
4
-
5
- export default class SyncDixStage extends BaseDixStage {
6
- syncedMaster: DTMaster | undefined;
7
-
8
- enter() {
9
- super.enter();
10
-
11
- // Sync with other master
12
- const syncedMaster = this.createMaster("dyo-test", this.master.getId());
13
-
14
- syncedMaster.updateFromDix(this.master.toDIXObject());
15
- this.syncedMaster = syncedMaster;
16
- }
17
-
18
- play() {
19
- super.play();
20
-
21
- // Sync with other master
22
- this.syncedMaster.updateFromDix(this.master.toDIXObject());
23
- }
24
-
25
- exit(skipEnding: boolean = false): IStageExit {
26
- super.exit(skipEnding);
27
-
28
- return {
29
- master: this.syncedMaster,
30
- outDIX: this.syncedMaster.toDIXObject(),
31
- expectedDIX: this.dixExit,
32
- }
33
- }
34
-
35
-
36
- }
@@ -1,55 +0,0 @@
1
- import {describe, expect, test,} from '@jest/globals';
2
- import BaseDixStage from "../stages/baseDix.stage";
3
- import EmptyScene from "../scenes/empty.scene";
4
- import SyncDixStage from "../stages/syncDix.stage";
5
- import PlayCardScene from "../scenes/playCard.scene";
6
- import DrawCardScene from "../scenes/drawCard.scene";
7
- import PlayerLeaveScene from "../scenes/playerLeave.scene";
8
-
9
- describe('Scenario 1 - Play a DYO Test round', () => {
10
- test('Scene 1 : Empty scene', () => {
11
- const stage = new BaseDixStage(new EmptyScene());
12
- stage.enter();
13
- stage.play();
14
- const { outDIX, expectedDIX } = stage.exit();
15
-
16
- expect(outDIX).toStrictEqual(expectedDIX);
17
- });
18
-
19
- test('Scene 2 : Empty scene synchronized', () => {
20
- const stage = new SyncDixStage(new EmptyScene());
21
- stage.enter();
22
- stage.play();
23
- const { outDIX, expectedDIX } = stage.exit();
24
-
25
- expect(outDIX).toStrictEqual(expectedDIX);
26
- });
27
-
28
- test('Scene 3 : Play a card', () => {
29
- const stage = new SyncDixStage(new PlayCardScene());
30
- stage.enter();
31
- stage.play();
32
- const { outDIX, expectedDIX } = stage.exit();
33
-
34
- expect(outDIX).toStrictEqual(expectedDIX);
35
- });
36
-
37
- test('Scene 4 : Draw a card', () => {
38
- const stage = new SyncDixStage(new DrawCardScene());
39
- stage.enter();
40
- stage.play();
41
- const { outDIX, expectedDIX } = stage.exit();
42
-
43
- expect(outDIX).toStrictEqual(expectedDIX);
44
- });
45
-
46
- test('Scene 5 : Player leaves', () => {
47
- const stage = new SyncDixStage(new PlayerLeaveScene());
48
- stage.enter();
49
- stage.play();
50
- const { outDIX, expectedDIX } = stage.exit();
51
-
52
- expect(outDIX).toStrictEqual(expectedDIX);
53
- });
54
-
55
- });
@@ -1,24 +0,0 @@
1
- import {DTMaster} from "../../src";
2
- import {DIXObject} from "../../src/types";
3
-
4
- export interface IStageExit {
5
- master: DTMaster,
6
- outDIX: Record<string, DIXObject>,
7
- expectedDIX: Record<string, DIXObject>,
8
- }
9
-
10
- export interface IStage {
11
- master: DTMaster,
12
- dixExit: Record<string, DIXObject>,
13
- enter: () => void,
14
- play: () => void,
15
- exit: (skipEnding: boolean) => IStageExit,
16
- }
17
-
18
- export interface IScene {
19
- play: (stage: IStage) => void,
20
- }
21
-
22
- export interface IEnding {
23
- exit: (stage: IStage) => IStageExit,
24
- }
@@ -1,25 +0,0 @@
1
- import type { JestConfigWithTsJest } from "ts-jest";
2
-
3
- // Jest Configuration for Integration Tests
4
- // Integration Tests are only for the test/integration folder
5
- const config: JestConfigWithTsJest = {
6
- verbose: true,
7
- transform: {
8
- "^.+\\.ts?$": [
9
- "ts-jest",
10
- {
11
- useESM: true,
12
- },
13
- ],
14
- },
15
- extensionsToTreatAsEsm: [".ts"],
16
- moduleNameMapper: {
17
- "^(\\.{1,2}/.*)\\.js$": "$1",
18
- },
19
- testMatch: ["<rootDir>/integration/**/*.spec.ts"],
20
- testPathIgnorePatterns: ["<rootDir>/dist/", "<rootDir>/node_modules/", "<rootDir>/test/"],
21
- };
22
-
23
- export default config;
24
-
25
-
package/jest.config.ts DELETED
@@ -1,26 +0,0 @@
1
- import type { JestConfigWithTsJest } from "ts-jest";
2
-
3
- // Jest Configuration for Unit Tests
4
- // Unit Tests are only for the test/core folder, excluding DIX methods
5
- // Other tests are in the integration folder
6
- const config: JestConfigWithTsJest = {
7
- verbose: true,
8
- transform: {
9
- "^.+\\.ts?$": [
10
- "ts-jest",
11
- {
12
- useESM: true,
13
- },
14
- ],
15
- },
16
- extensionsToTreatAsEsm: [".ts"],
17
- moduleNameMapper: {
18
- "^(\\.{1,2}/.*)\\.js$": "$1",
19
- },
20
- testMatch: ["<rootDir>/test/core/*.spec.ts"],
21
- testPathIgnorePatterns: ["<rootDir>/dist/", "<rootDir>/node_modules/", "<rootDir>/integration/"],
22
- };
23
-
24
- export default config;
25
-
26
-