pixi-rainman-game-engine 0.2.29 → 0.3.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 (179) hide show
  1. package/dist/ComponentRegistry/ComponentRegistry.d.ts +23 -9
  2. package/dist/ComponentRegistry/ComponentRegistry.js +25 -10
  3. package/dist/ComponentRegistry/types.d.ts +0 -2
  4. package/dist/DescribedPlayableAction/DescribedPlayableAction.d.ts +2 -0
  5. package/dist/DescribedPlayableAction/DescribedPlayableAction.js +2 -0
  6. package/dist/Money/MoneyText.d.ts +5 -0
  7. package/dist/Money/MoneyText.js +5 -0
  8. package/dist/Rainman/Rainman.d.ts +7 -2
  9. package/dist/Rainman/Rainman.js +21 -1
  10. package/dist/Rainman/types.d.ts +1 -0
  11. package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.d.ts +4 -0
  12. package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.js +4 -0
  13. package/dist/SettingsUI/hooks/useDeviceOrientations.d.ts +4 -0
  14. package/dist/SettingsUI/hooks/useDeviceOrientations.js +4 -0
  15. package/dist/application/ApiConfig/ApiConfig.d.ts +2 -1
  16. package/dist/application/ApiConfig/ApiConfig.js +3 -2
  17. package/dist/application/ApiConfig/SymbolId.d.ts +1 -1
  18. package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +35 -5
  19. package/dist/application/ButtonsEventManager/ButtonsEventManager.js +38 -7
  20. package/dist/application/SoundManager/SoundManager.d.ts +26 -1
  21. package/dist/application/SoundManager/SoundManager.js +30 -2
  22. package/dist/application/SpeedState/SpeedAdapter.d.ts +9 -0
  23. package/dist/application/SpeedState/SpeedAdapter.js +9 -0
  24. package/dist/application/SpeedState/SpeedLevel.d.ts +42 -0
  25. package/dist/application/SpeedState/SpeedLevel.js +30 -0
  26. package/dist/application/SpeedState/SpeedLevelHandler.d.ts +7 -0
  27. package/dist/application/SpeedState/SpeedLevelHandler.js +7 -0
  28. package/dist/application/SpinLogic/SpinLogic.d.ts +58 -0
  29. package/dist/application/SpinLogic/SpinLogic.js +58 -0
  30. package/dist/application/SpinLogic/SpinLogicDTO.d.ts +70 -0
  31. package/dist/application/SpinLogic/SpinLogicDTO.js +70 -0
  32. package/dist/application/SpinLogic/WinScenarios.d.ts +12 -0
  33. package/dist/application/SpinLogic/WinScenarios.js +12 -0
  34. package/dist/application/SpinLogic/types.d.ts +10 -0
  35. package/dist/application/TimedActions/IncentiveComponent.d.ts +10 -0
  36. package/dist/application/TimedActions/IncentiveComponent.js +9 -1
  37. package/dist/application/TimedActions/TimedIncentiveController.d.ts +37 -0
  38. package/dist/application/TimedActions/TimedIncentiveController.js +37 -0
  39. package/dist/application/setup.d.ts +0 -1
  40. package/dist/application/setup.js +0 -1
  41. package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.d.ts +36 -1
  42. package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.js +25 -0
  43. package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +83 -2
  44. package/dist/components/AbstractMainContainer/AbstractMainContainer.js +97 -11
  45. package/dist/components/DoubleBorderText/DoubleBorderText.d.ts +10 -0
  46. package/dist/components/DoubleBorderText/DoubleBorderText.js +24 -0
  47. package/dist/components/DoubleBorderText/index.d.ts +1 -0
  48. package/dist/components/DoubleBorderText/index.js +1 -0
  49. package/dist/components/GambleGame/GambleGame.d.ts +39 -0
  50. package/dist/components/GambleGame/GambleGame.js +43 -3
  51. package/dist/components/GambleGame/types.d.ts +5 -0
  52. package/dist/components/buttons/BaseButton/BaseButton.d.ts +72 -1
  53. package/dist/components/buttons/BaseButton/BaseButton.js +73 -2
  54. package/dist/components/buttons/BaseButton/types.d.ts +5 -0
  55. package/dist/components/buttons/buttonGroups/LeftButtons.d.ts +11 -0
  56. package/dist/components/buttons/buttonGroups/LeftButtons.js +11 -0
  57. package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.d.ts +13 -1
  58. package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.js +13 -1
  59. package/dist/components/buttons/buttonGroups/LeftButtonsMobile.d.ts +19 -1
  60. package/dist/components/buttons/buttonGroups/LeftButtonsMobile.js +19 -1
  61. package/dist/components/buttons/buttonGroups/MiddleButtons.d.ts +18 -1
  62. package/dist/components/buttons/buttonGroups/MiddleButtons.js +18 -1
  63. package/dist/components/buttons/buttonGroups/RightButtons.d.ts +10 -0
  64. package/dist/components/buttons/buttonGroups/RightButtons.js +10 -0
  65. package/dist/components/buttons/buttonGroups/RightButtonsLandscape.d.ts +11 -0
  66. package/dist/components/buttons/buttonGroups/RightButtonsLandscape.js +11 -0
  67. package/dist/components/buttons/buttonGroups/RightButtonsMobile.d.ts +17 -0
  68. package/dist/components/buttons/buttonGroups/RightButtonsMobile.js +17 -0
  69. package/dist/components/buttons/default/AutoplayButton.d.ts +6 -0
  70. package/dist/components/buttons/default/AutoplayButton.js +8 -1
  71. package/dist/components/buttons/default/RefreshButton.d.ts +30 -0
  72. package/dist/components/buttons/default/RefreshButton.js +36 -3
  73. package/dist/components/buttons/default/SpeedControlButton.d.ts +2 -0
  74. package/dist/components/buttons/default/SpeedControlButton.js +2 -0
  75. package/dist/components/buttons/default/VolumeButton.d.ts +2 -0
  76. package/dist/components/buttons/default/VolumeButton.js +2 -0
  77. package/dist/components/common/AnimatedBackground.d.ts +22 -0
  78. package/dist/components/common/AnimatedBackground.js +22 -0
  79. package/dist/components/common/AnimatedNumber.d.ts +36 -0
  80. package/dist/components/common/AnimatedNumber.js +36 -0
  81. package/dist/components/common/Background.d.ts +20 -0
  82. package/dist/components/common/Background.js +22 -1
  83. package/dist/components/common/FreeSpinButton.d.ts +33 -1
  84. package/dist/components/common/FreeSpinButton.js +37 -4
  85. package/dist/components/common/IResizableContainer.d.ts +4 -0
  86. package/dist/components/common/Logo.d.ts +21 -0
  87. package/dist/components/common/Logo.js +21 -0
  88. package/dist/components/common/LogoStatic.d.ts +10 -0
  89. package/dist/components/common/LogoStatic.js +10 -0
  90. package/dist/components/common/ResponsiveComponent.d.ts +22 -0
  91. package/dist/components/common/ResponsiveComponent.js +10 -0
  92. package/dist/components/common/ResumableContainers.d.ts +6 -0
  93. package/dist/components/common/ResumableContainers.js +6 -0
  94. package/dist/components/common/ScalableSpine.d.ts +11 -0
  95. package/dist/components/common/ScalableSpine.js +11 -0
  96. package/dist/components/frame/AbstractColumnsContainer.d.ts +20 -6
  97. package/dist/components/frame/AbstractColumnsContainer.js +18 -4
  98. package/dist/components/frame/AbstractFrame.d.ts +115 -0
  99. package/dist/components/frame/AbstractFrame.js +97 -2
  100. package/dist/components/frame/AbstractInnerFrame.d.ts +5 -0
  101. package/dist/components/frame/AbstractInnerFrame.js +5 -0
  102. package/dist/components/frame/WinLineAnimation.d.ts +10 -0
  103. package/dist/components/frame/WinLineAnimation.js +12 -1
  104. package/dist/components/frame/constants.d.ts +7 -0
  105. package/dist/components/frame/constants.js +3 -0
  106. package/dist/components/index.d.ts +1 -0
  107. package/dist/components/index.js +1 -0
  108. package/dist/components/messageBox/MessageBox.d.ts +33 -0
  109. package/dist/components/messageBox/MessageBox.js +33 -0
  110. package/dist/components/symbols/AbstractSymbolBase.d.ts +146 -2
  111. package/dist/components/symbols/AbstractSymbolBase.js +137 -14
  112. package/dist/components/symbols/AbstractSymbolsColumn.d.ts +233 -3
  113. package/dist/components/symbols/AbstractSymbolsColumn.js +220 -10
  114. package/dist/components/symbols/DroppableSymbol.d.ts +16 -0
  115. package/dist/components/symbols/DroppableSymbol.js +16 -0
  116. package/dist/components/symbols/DroppableSymbolsColumn.d.ts +51 -0
  117. package/dist/components/symbols/DroppableSymbolsColumn.js +57 -3
  118. package/dist/components/symbols/types.d.ts +8 -0
  119. package/dist/components/symbols/types.js +4 -0
  120. package/dist/components/updatable/GambleUpdatableText.d.ts +5 -0
  121. package/dist/components/updatable/GambleUpdatableText.js +5 -0
  122. package/dist/components/updatable/StylefulUpdatableText.d.ts +23 -0
  123. package/dist/components/updatable/StylefulUpdatableText.js +25 -1
  124. package/dist/components/updatable/UpdatableValueComponent.d.ts +71 -0
  125. package/dist/components/updatable/UpdatableValueComponent.js +77 -4
  126. package/dist/connectivity/ConnectionWrapper.d.ts +20 -1
  127. package/dist/connectivity/ConnectionWrapper.js +23 -3
  128. package/dist/connectivity/LocalConnectionWrapper.d.ts +2 -2
  129. package/dist/connectivity/LocalConnectionWrapper.js +2 -2
  130. package/dist/connectivity/serverConnection.d.ts +59 -0
  131. package/dist/connectivity/serverData.d.ts +3 -1
  132. package/dist/connectivity/spinData.d.ts +15 -0
  133. package/dist/connectivity/spinData.js +15 -0
  134. package/dist/constants/gamePhase.d.ts +4 -0
  135. package/dist/controllers/AbstractController.d.ts +114 -5
  136. package/dist/controllers/AbstractController.js +143 -22
  137. package/dist/controllers/QuickStopController.d.ts +3 -0
  138. package/dist/controllers/QuickStopController.js +3 -0
  139. package/dist/controllers/UiController.d.ts +163 -1
  140. package/dist/controllers/UiController.js +170 -5
  141. package/dist/errors/LanguageNotDefinedError.d.ts +4 -0
  142. package/dist/errors/LanguageNotDefinedError.js +4 -0
  143. package/dist/errors/SpineDataNotFound.d.ts +4 -0
  144. package/dist/errors/SpineDataNotFound.js +4 -0
  145. package/dist/errors/TextureNotFound.d.ts +4 -0
  146. package/dist/errors/TextureNotFound.js +4 -0
  147. package/dist/loading/AbstractLoadingContainer.d.ts +16 -0
  148. package/dist/loading/AbstractLoadingContainer.js +16 -0
  149. package/dist/loading/SpriteLoadingContainer.d.ts +18 -0
  150. package/dist/loading/SpriteLoadingContainer.js +18 -0
  151. package/dist/localStorage/localStorage.d.ts +23 -0
  152. package/dist/localStorage/localStorage.js +19 -0
  153. package/dist/stores/SettingsStore.d.ts +269 -3
  154. package/dist/stores/SettingsStore.js +289 -13
  155. package/dist/stores/types.d.ts +4 -0
  156. package/dist/utils/assets/assetGetter.js +6 -3
  157. package/dist/utils/common/deviceOrientation.js +2 -1
  158. package/dist/utils/common/functions.d.ts +57 -1
  159. package/dist/utils/common/functions.js +63 -4
  160. package/dist/utils/common/logger.js +4 -2
  161. package/dist/utils/common/placementHelpers.d.ts +14 -0
  162. package/dist/utils/common/placementHelpers.js +20 -1
  163. package/dist/utils/common/screenHelpers.d.ts +28 -0
  164. package/dist/utils/common/screenHelpers.js +34 -3
  165. package/dist/utils/common/sound.d.ts +1 -0
  166. package/dist/utils/common/sound.js +2 -0
  167. package/dist/utils/common/stats.d.ts +1 -0
  168. package/dist/utils/common/stats.js +2 -0
  169. package/dist/winComponents/AnimableParticlesEmitter.d.ts +6 -0
  170. package/dist/winComponents/AnimableParticlesEmitter.js +6 -0
  171. package/dist/winComponents/BaseWinContainer.d.ts +64 -0
  172. package/dist/winComponents/BaseWinContainer.js +66 -1
  173. package/dist/winComponents/PositioningFrame.d.ts +7 -0
  174. package/dist/winComponents/PositioningFrame.js +7 -0
  175. package/dist/winComponents/TexturedText.d.ts +23 -0
  176. package/dist/winComponents/TexturedText.js +23 -0
  177. package/dist/winComponents/UpdatableSpineContainer.d.ts +25 -0
  178. package/dist/winComponents/UpdatableSpineContainer.js +25 -0
  179. package/package.json +3 -1
@@ -3,6 +3,9 @@ import { SpeedLevel } from "../application";
3
3
  import { RegistryMap } from "./types";
4
4
  /**
5
5
  * Class for managing components in game
6
+ * Especially for managing components that are speed adaptable and updating the text.
7
+ * This is important for the game logic, as it allows to change the speed of the game
8
+ * and update the components that are speed adaptable.
6
9
  * @class ComponentRegistry
7
10
  */
8
11
  export declare class ComponentRegistry {
@@ -15,22 +18,26 @@ export declare class ComponentRegistry {
15
18
  * Method for changing temporarily speed for turbo spin
16
19
  * @public
17
20
  * @param {SpeedLevel} newSpeedLevel - new speed level
21
+ * @returns {void}
18
22
  */
19
23
  setTemporarySpeedLevel(newSpeedLevel: SpeedLevel): void;
20
24
  /**
21
25
  * Method for reverting speed level for turbo spin
22
26
  * @public
27
+ * @returns {void}
23
28
  */
24
29
  revertTemporarySpeedLevel(): void;
25
30
  /**
26
31
  * Setter fo speed level
27
32
  * @public
28
33
  * @param {SpeedLevel} newSpeedLevel - new speed level
34
+ * @returns {void}
29
35
  */
30
36
  setSpeedLevel(newSpeedLevel: SpeedLevel): void;
31
37
  /**
32
38
  * Setting the next available speed level
33
39
  * @public
40
+ * @returns {void}
34
41
  */
35
42
  nextSpeedLevel(): void;
36
43
  /**
@@ -42,12 +49,14 @@ export declare class ComponentRegistry {
42
49
  /**
43
50
  * Setter for user activity time
44
51
  * @public
52
+ * @returns {void}
45
53
  */
46
54
  setUserActivityTime(): void;
47
55
  /**
48
56
  * Function for adding components into ComponentRegistry
49
57
  * @public
50
58
  * @param {Container} component component to be added
59
+ * @returns {void}
51
60
  */
52
61
  add(component: Container): void;
53
62
  /**
@@ -55,18 +64,21 @@ export declare class ComponentRegistry {
55
64
  * @public
56
65
  * @param {Container} oldComponent - old component
57
66
  * @param {Container} newComponent - new component
67
+ * @returns {void}
58
68
  */
59
69
  update(oldComponent: Container, newComponent: Container): void;
60
70
  /**
61
71
  * Function for removing components from Component Registry
62
72
  * @public
63
73
  * @param {Container} component - component to be removed
74
+ * @returns {void}
64
75
  */
65
76
  remove(component: Container): void;
66
77
  /**
67
78
  * Function that adapt speed of all components
68
79
  * @public
69
- * @param {SpeedLevel} speedLevel - speed lever for updating
80
+ * @param {SpeedLevel} speedLevel new speed level to adapt
81
+ * @returns {void}
70
82
  */
71
83
  updateAllSpeedAdaptable(speedLevel: SpeedLevel): void;
72
84
  /**
@@ -74,36 +86,38 @@ export declare class ComponentRegistry {
74
86
  * Throws error if component is not present
75
87
  * @public
76
88
  * @template {keyof RegistryMap} T
77
- * @param {T} componentName - name of the component
78
- * @returns {RegistryMap[T]} - component from registry
89
+ * @param {T} componentName name of the component
90
+ * @returns {RegistryMap[T]} component from registry
79
91
  */
80
92
  get<T extends keyof RegistryMap>(componentName: T): RegistryMap[T];
81
93
  /**
82
94
  * Getter for existing components that are in ComponentRegistry
83
95
  * @public
84
96
  * @template {keyof RegistryMap} T
85
- * @param {T} componentName - component name
86
- * @returns {RegistryMap[T]} - component from registry
97
+ * @param {T} componentName component name
98
+ * @returns {RegistryMap[T]} component from registry
87
99
  */
88
100
  getIfExists<T extends keyof RegistryMap>(componentName: T): RegistryMap[T];
89
101
  /**
90
102
  * Helper function to check if the component is present in ComponentRegistry
91
103
  * @public
92
104
  * @template {keyof RegistryMap} T
93
- * @param {T} componentName - component name
94
- * @returns {boolean} - true if component is present
105
+ * @param {T} componentName component name
106
+ * @returns {boolean} true if component is present otherwise false
95
107
  */
96
108
  has<T extends keyof RegistryMap>(componentName: T): boolean;
97
109
  /**
98
110
  * Function for adding components
99
111
  * @public
100
- * @param {Container[]} components - components to be added
112
+ * @param {Container[]} components components to be added
113
+ * @returns {void}
101
114
  */
102
115
  addMany(components: Container[]): void;
103
116
  /**
104
117
  * Function for removing components
105
118
  * @public
106
- * @param {Container[]} components - components to be removed
119
+ * @param {Container[]} components components to be removed
120
+ * @returns {void}
107
121
  */
108
122
  removeMany(components: Container[]): void;
109
123
  }
@@ -4,6 +4,9 @@ import { RainMan } from "../Rainman";
4
4
  import { openFullscreen } from "../utils";
5
5
  /**
6
6
  * Class for managing components in game
7
+ * Especially for managing components that are speed adaptable and updating the text.
8
+ * This is important for the game logic, as it allows to change the speed of the game
9
+ * and update the components that are speed adaptable.
7
10
  * @class ComponentRegistry
8
11
  */
9
12
  export class ComponentRegistry {
@@ -21,6 +24,7 @@ export class ComponentRegistry {
21
24
  * Method for changing temporarily speed for turbo spin
22
25
  * @public
23
26
  * @param {SpeedLevel} newSpeedLevel - new speed level
27
+ * @returns {void}
24
28
  */
25
29
  setTemporarySpeedLevel(newSpeedLevel) {
26
30
  this.speedLevelHandler.setSpeed(newSpeedLevel);
@@ -29,6 +33,7 @@ export class ComponentRegistry {
29
33
  /**
30
34
  * Method for reverting speed level for turbo spin
31
35
  * @public
36
+ * @returns {void}
32
37
  */
33
38
  revertTemporarySpeedLevel() {
34
39
  this.speedLevelHandler.setSpeed(RainMan.settingsStore.currentSpeed);
@@ -38,6 +43,7 @@ export class ComponentRegistry {
38
43
  * Setter fo speed level
39
44
  * @public
40
45
  * @param {SpeedLevel} newSpeedLevel - new speed level
46
+ * @returns {void}
41
47
  */
42
48
  setSpeedLevel(newSpeedLevel) {
43
49
  this.speedLevelHandler.setSpeed(newSpeedLevel);
@@ -48,6 +54,7 @@ export class ComponentRegistry {
48
54
  /**
49
55
  * Setting the next available speed level
50
56
  * @public
57
+ * @returns {void}
51
58
  */
52
59
  nextSpeedLevel() {
53
60
  this.speedLevelHandler.nextSpeed();
@@ -66,6 +73,7 @@ export class ComponentRegistry {
66
73
  /**
67
74
  * Setter for user activity time
68
75
  * @public
76
+ * @returns {void}
69
77
  */
70
78
  setUserActivityTime() {
71
79
  this.incentiveJobsManager.updateLastTimeClicked();
@@ -74,6 +82,7 @@ export class ComponentRegistry {
74
82
  * Function for adding components into ComponentRegistry
75
83
  * @public
76
84
  * @param {Container} component component to be added
85
+ * @returns {void}
77
86
  */
78
87
  add(component) {
79
88
  if (isSpeedAdapterInterface(component)) {
@@ -96,6 +105,7 @@ export class ComponentRegistry {
96
105
  * @public
97
106
  * @param {Container} oldComponent - old component
98
107
  * @param {Container} newComponent - new component
108
+ * @returns {void}
99
109
  */
100
110
  update(oldComponent, newComponent) {
101
111
  if (oldComponent.name !== newComponent.name) {
@@ -107,13 +117,15 @@ export class ComponentRegistry {
107
117
  this.speedAdaptableComponents.add(newComponent);
108
118
  }
109
119
  }
110
- if (oldComponent.name)
120
+ if (oldComponent.name) {
111
121
  this.registry.set(oldComponent.name, newComponent);
122
+ }
112
123
  }
113
124
  /**
114
125
  * Function for removing components from Component Registry
115
126
  * @public
116
127
  * @param {Container} component - component to be removed
128
+ * @returns {void}
117
129
  */
118
130
  remove(component) {
119
131
  if (component.name)
@@ -122,7 +134,8 @@ export class ComponentRegistry {
122
134
  /**
123
135
  * Function that adapt speed of all components
124
136
  * @public
125
- * @param {SpeedLevel} speedLevel - speed lever for updating
137
+ * @param {SpeedLevel} speedLevel new speed level to adapt
138
+ * @returns {void}
126
139
  */
127
140
  updateAllSpeedAdaptable(speedLevel) {
128
141
  this.speedAdaptableComponents.forEach((speedAdaptableComponent) => {
@@ -134,8 +147,8 @@ export class ComponentRegistry {
134
147
  * Throws error if component is not present
135
148
  * @public
136
149
  * @template {keyof RegistryMap} T
137
- * @param {T} componentName - name of the component
138
- * @returns {RegistryMap[T]} - component from registry
150
+ * @param {T} componentName name of the component
151
+ * @returns {RegistryMap[T]} component from registry
139
152
  */
140
153
  get(componentName) {
141
154
  const componentToReturn = this.registry.get(componentName);
@@ -148,8 +161,8 @@ export class ComponentRegistry {
148
161
  * Getter for existing components that are in ComponentRegistry
149
162
  * @public
150
163
  * @template {keyof RegistryMap} T
151
- * @param {T} componentName - component name
152
- * @returns {RegistryMap[T]} - component from registry
164
+ * @param {T} componentName component name
165
+ * @returns {RegistryMap[T]} component from registry
153
166
  */
154
167
  getIfExists(componentName) {
155
168
  const componentToReturn = this.registry.get(componentName);
@@ -159,8 +172,8 @@ export class ComponentRegistry {
159
172
  * Helper function to check if the component is present in ComponentRegistry
160
173
  * @public
161
174
  * @template {keyof RegistryMap} T
162
- * @param {T} componentName - component name
163
- * @returns {boolean} - true if component is present
175
+ * @param {T} componentName component name
176
+ * @returns {boolean} true if component is present otherwise false
164
177
  */
165
178
  has(componentName) {
166
179
  return this.registry.has(componentName);
@@ -168,7 +181,8 @@ export class ComponentRegistry {
168
181
  /**
169
182
  * Function for adding components
170
183
  * @public
171
- * @param {Container[]} components - components to be added
184
+ * @param {Container[]} components components to be added
185
+ * @returns {void}
172
186
  */
173
187
  addMany(components) {
174
188
  for (const component of components) {
@@ -178,7 +192,8 @@ export class ComponentRegistry {
178
192
  /**
179
193
  * Function for removing components
180
194
  * @public
181
- * @param {Container[]} components - components to be removed
195
+ * @param {Container[]} components components to be removed
196
+ * @returns {void}
182
197
  */
183
198
  removeMany(components) {
184
199
  for (const component of components) {
@@ -2,8 +2,6 @@ import { AbstractColumnsContainer, AbstractFrame, AbstractInnerFrame, AutoplayBu
2
2
  /**
3
3
  * RegistryMap is a map of all components that are registered in the ComponentRegistry.
4
4
  * It is used to type-check the components that are registered in the ComponentRegistry.
5
- *
6
- *
7
5
  */
8
6
  export interface RegistryMap {
9
7
  [MessageBox.autoSpinTextRegistryName]: UpdatableValueComponent;
@@ -1,6 +1,8 @@
1
1
  import { Nullable, PlayableAction } from "../utils";
2
2
  /**
3
3
  * Class representing a described playable action in action queue.
4
+ * @template T - Type of the action
5
+ * @class DescribedPlayableAction
4
6
  */
5
7
  export declare class DescribedPlayableAction<T> {
6
8
  readonly type: T;
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * Class representing a described playable action in action queue.
3
+ * @template T - Type of the action
4
+ * @class DescribedPlayableAction
3
5
  */
4
6
  export class DescribedPlayableAction {
5
7
  type;
@@ -6,5 +6,10 @@
6
6
  export declare class MoneyText {
7
7
  private readonly money;
8
8
  constructor(amount: number);
9
+ /**
10
+ * Function for converting money to string with currency symbol included
11
+ * @public
12
+ * @returns {string} money as string
13
+ */
9
14
  toString(): string;
10
15
  }
@@ -10,6 +10,11 @@ export class MoneyText {
10
10
  constructor(amount) {
11
11
  this.money = Money.fromDecimal(amount, RainMan.globals.currency, Math.round);
12
12
  }
13
+ /**
14
+ * Function for converting money to string with currency symbol included
15
+ * @public
16
+ * @returns {string} money as string
17
+ */
13
18
  toString() {
14
19
  return `${this.money} ${RainMan.globals.currency.symbol_native}`;
15
20
  }
@@ -3,7 +3,7 @@ import { Application } from "pixi.js";
3
3
  import { SymbolIds, WinTypeIds } from "../application";
4
4
  import { ComponentRegistry } from "../ComponentRegistry";
5
5
  import { SettingsStore } from "../stores";
6
- import { AppConfig, Globals, OptionalAppConfig, RequiredAppConfig } from "./types";
6
+ import { AppConfigWithoutToken, Globals, OptionalAppConfig, RequiredAppConfig } from "./types";
7
7
  /**
8
8
  * This class represents Pixi application. Before initializing game, user has to configure following:
9
9
  * - {@link Application}
@@ -20,5 +20,10 @@ export declare class RainMan {
20
20
  static settingsStore: SettingsStore;
21
21
  static componentRegistry: ComponentRegistry;
22
22
  static globals: Globals;
23
- constructor(app: Application, config: AppConfig, symbolIds: SymbolIds, winTypeIds: WinTypeIds);
23
+ constructor(app: Application, config: AppConfigWithoutToken, symbolIds: SymbolIds, winTypeIds: WinTypeIds);
24
+ /**
25
+ * Method for genereting a token or getting existing token for the game session.
26
+ * @returns {string} - token for the game session
27
+ */
28
+ private getToken;
24
29
  }
@@ -1,6 +1,7 @@
1
1
  import "../components/dictionary/i18n";
2
2
  import { merge } from "lodash";
3
3
  import { Currencies } from "ts-money";
4
+ import uuid4 from "uuid4";
4
5
  import { ComponentRegistry } from "../ComponentRegistry";
5
6
  import { settingStore } from "../SettingsUI/hooks";
6
7
  import { defaultAppConfig } from "./appConfig";
@@ -22,7 +23,9 @@ export class RainMan {
22
23
  static globals;
23
24
  constructor(app, config, symbolIds, winTypeIds) {
24
25
  RainMan.app = app;
25
- RainMan.config = merge(defaultAppConfig, config);
26
+ RainMan.config = merge({}, defaultAppConfig, config, {
27
+ gameInitToken: this.getToken()
28
+ });
26
29
  RainMan.symbolIds = symbolIds;
27
30
  RainMan.winTypeIds = winTypeIds;
28
31
  RainMan.settingsStore = settingStore;
@@ -32,4 +35,21 @@ export class RainMan {
32
35
  shouldShowModals: false
33
36
  };
34
37
  }
38
+ /**
39
+ * Method for genereting a token or getting existing token for the game session.
40
+ * @returns {string} - token for the game session
41
+ */
42
+ getToken() {
43
+ const url = new URL(window.location.href);
44
+ let token = url.searchParams.get("token");
45
+ if (token) {
46
+ return token;
47
+ }
48
+ else {
49
+ token = uuid4();
50
+ url.searchParams.set("token", token);
51
+ window.history.replaceState({}, "", url.toString());
52
+ return token;
53
+ }
54
+ }
35
55
  }
@@ -62,6 +62,7 @@ export type OptionalAppConfig = {
62
62
  };
63
63
  };
64
64
  export type AppConfig = RequiredAppConfig & DeepPartial<OptionalAppConfig>;
65
+ export type AppConfigWithoutToken = Omit<RequiredAppConfig, "gameInitToken"> & DeepPartial<OptionalAppConfig>;
65
66
  /**
66
67
  * This interface represents global variables in pixi application. Can be extended in `engine.d.ts` in each project to provide project-wide variables.
67
68
  */
@@ -1,2 +1,6 @@
1
1
  import { BuyFreeSpinOption } from "./types";
2
+ /**
3
+ * Get the available options for buying free spins
4
+ * @returns {BuyFreeSpinOption[]} the available options for buying free spins
5
+ */
2
6
  export declare const useBuyFreeSpinOptions: () => BuyFreeSpinOption[];
@@ -1,6 +1,10 @@
1
1
  import { autorun } from "mobx";
2
2
  import { useEffect, useState } from "react";
3
3
  import { RainMan } from "../../../Rainman";
4
+ /**
5
+ * Get the available options for buying free spins
6
+ * @returns {BuyFreeSpinOption[]} the available options for buying free spins
7
+ */
4
8
  export const useBuyFreeSpinOptions = () => {
5
9
  const [options, setOptions] = useState([]);
6
10
  useEffect(() => {
@@ -1,2 +1,6 @@
1
1
  import { DeviceOrientation } from "../../utils";
2
+ /**
3
+ * Get the current device orientation
4
+ * @returns {DeviceOrientation} the current device orientation
5
+ */
2
6
  export declare const useDeviceOrientations: () => DeviceOrientation;
@@ -1,5 +1,9 @@
1
1
  import { useEffect, useState } from "react";
2
2
  import { getDeviceOrientation } from "../../utils";
3
+ /**
4
+ * Get the current device orientation
5
+ * @returns {DeviceOrientation} the current device orientation
6
+ */
3
7
  export const useDeviceOrientations = () => {
4
8
  const [deviceOrientation, setDeviceOrientation] = useState("pc");
5
9
  useEffect(() => {
@@ -10,14 +10,15 @@ import { WinTypeId } from "./WinTypeId";
10
10
  */
11
11
  export declare class ApiConfig {
12
12
  readonly token: string;
13
+ extraData: InitExtraData;
13
14
  symbolMap: Map<number, never>;
14
15
  streakMap: Map<string, number>;
15
16
  private readonly bets;
16
17
  private winMap;
17
18
  private transformationMap;
18
- extraData: InitExtraData;
19
19
  /**
20
20
  * Create instance of ApiConfig, requires InitDataInterface
21
+ * @public
21
22
  * @param {InitDataInterface} data - initail data from backend
22
23
  */
23
24
  constructor(data: InitDataInterface);
@@ -8,14 +8,15 @@ import { isBlindsConfiguredByTransformations } from "../SpinLogic";
8
8
  */
9
9
  export class ApiConfig {
10
10
  token;
11
+ extraData;
11
12
  symbolMap = new Map();
12
13
  streakMap = new Map();
13
14
  bets;
14
15
  winMap = new Map();
15
16
  transformationMap = new Map();
16
- extraData;
17
17
  /**
18
18
  * Create instance of ApiConfig, requires InitDataInterface
19
+ * @public
19
20
  * @param {InitDataInterface} data - initail data from backend
20
21
  */
21
22
  constructor(data) {
@@ -170,7 +171,7 @@ export class ApiConfig {
170
171
  */
171
172
  initSymbolMap(data) {
172
173
  if (Object.keys(RainMan.symbolIds).length !== data.symbols.length) {
173
- logError(`🛑 SYMBOL_IDS does not match symbols_names!`);
174
+ logError("🛑 SYMBOL_IDS does not match symbols_names!");
174
175
  logError(RainMan.symbolIds, data.symbols_names);
175
176
  throw new Error("Check and fix SYMBOL_IDS");
176
177
  }
@@ -6,7 +6,7 @@
6
6
  * interface SymbolIds {
7
7
  * cherries: "cherries",
8
8
  * lemon: "lemon",
9
- * }
9
+ * }
10
10
  * ```
11
11
  * @interface SymbolIds
12
12
  * @typedef {SymbolIds}
@@ -1,9 +1,9 @@
1
+ import { BetStrategy } from "controllers";
1
2
  import { Nullable } from "../../utils";
2
3
  /** @ignore */
3
4
  export declare const SPEED_PREFIX = "speed-";
4
5
  /**
5
6
  * Class for managing buttons in games
6
- *
7
7
  * This class includes methods for enabling/disabling buttons in game.
8
8
  *
9
9
  * The buttons that include each game:
@@ -14,6 +14,7 @@ export declare const SPEED_PREFIX = "speed-";
14
14
  * - More Button
15
15
  * - Autoplay Button
16
16
  * - Volume Button
17
+ * @class ButtonsEventManager
17
18
  */
18
19
  export declare class ButtonsEventManager {
19
20
  private settingsPlusButton;
@@ -24,50 +25,71 @@ export declare class ButtonsEventManager {
24
25
  private settingsSpeedCheetah;
25
26
  /**
26
27
  * Last layer invoked
28
+ * @private
27
29
  * @memberof ButtonsEventManager
28
30
  */
29
31
  private lastLayerInvoked;
30
32
  /**
31
33
  * Speed popup shown at for measuring time of showing speed popup
34
+ * @public
32
35
  * @memberof ButtonsEventManager
33
36
  */
34
37
  speedPopupShownAt: number;
35
38
  /**
36
39
  * Function for enabling/disabling buttons in game
40
+ * @private
37
41
  * @param {boolean} makeDisabled - flag for enabling/disabling buttons
38
42
  * @returns {() => void} function for enabling/disabling buttons
39
43
  */
40
44
  private setButtonAvailability;
45
+ /**
46
+ * Function for enabling buttons in the game
47
+ * In some game phases, games need to have buttons enabled.
48
+ * @public
49
+ * @returns {void}
50
+ */
41
51
  enableButtons: () => void;
52
+ /**
53
+ * Function for disabling buttons in the game
54
+ * In some game phases, games need to have buttons disabled.
55
+ * @public
56
+ * @returns {void}
57
+ */
42
58
  disableButtons: () => void;
43
59
  constructor();
44
60
  /**
45
61
  * Method for initializing events in Settings UI
62
+ * This method also change the incentive text based on the selected speed level
46
63
  * @public
64
+ * @returns {void}
47
65
  */
48
66
  initSettingsEvents(): void;
49
67
  /**
50
68
  * Method for setting up animated background
51
69
  * @public
70
+ * @returns {void}
52
71
  */
53
72
  setUpUIElementsInteractivity(): void;
54
73
  /**
55
74
  * Method for initializing Plus button
56
75
  * This method changes bet in game based on given strategy
57
76
  * @public
58
- * @param {(strategy: "first" | "increase" | "decrease") => void} setBetCallback - callback for setting bet
77
+ * @param {(strategy: BetStrategy) => void} setBetCallback - callback for setting bet
78
+ * @returns {void}
59
79
  */
60
- initBetPlusButtonEvent(setBetCallback: (strategy: "first" | "increase" | "decrease") => void): void;
80
+ initBetPlusButtonEvent(setBetCallback: (strategy: BetStrategy) => void): void;
61
81
  /**
62
82
  * Method for initializing Neg button
63
83
  * This method changes bet in game based on given strategy
64
84
  * @public
65
- * @param {(strategy: "first" | "increase" | "decrease") => void} setBetCallback - callback for setting bet
85
+ * @param {(strategy: BetStrategy) => void} setBetCallback - callback for setting bet
86
+ * @returns {void}
66
87
  */
67
- initBetMinusButtonEvent(setBetCallback: (strategy: "first" | "increase" | "decrease") => void): void;
88
+ initBetMinusButtonEvent(setBetCallback: (strategy: BetStrategy) => void): void;
68
89
  /**
69
90
  * Method for enabling ability to buy free spins in game
70
91
  * @public
92
+ * @returns {void}
71
93
  */
72
94
  initFreeSpinModal(): void;
73
95
  /**
@@ -75,21 +97,25 @@ export declare class ButtonsEventManager {
75
97
  * This method changes texture of Volume button based on volume level
76
98
  * If music was muted, it will be resumed
77
99
  * @public
100
+ * @returns {void}
78
101
  */
79
102
  initVolumeButtonEvent(): void;
80
103
  /**
81
104
  * Method for initializing button with information about mechanics in game
82
105
  * @public
106
+ * @returns {void} - void
83
107
  */
84
108
  initInfoButtonEvent(): void;
85
109
  /**
86
110
  * Method for initializing more button
87
111
  * @public
112
+ * @returns {void} - void
88
113
  */
89
114
  initMoreButtonEvent(): void;
90
115
  /**
91
116
  * Method for initializing Autoplay button
92
117
  * @public
118
+ * @returns {void} - void
93
119
  */
94
120
  initAutoplayButtonEvent(): void;
95
121
  /**
@@ -97,6 +123,7 @@ export declare class ButtonsEventManager {
97
123
  * @public
98
124
  * @param {() => void} onClick - callback for gamble game
99
125
  * @param {boolean} disabled - flag for enabling/disabling button
126
+ * @returns {void}
100
127
  */
101
128
  initGambleButton(onClick: () => void, disabled: boolean): void;
102
129
  /**
@@ -104,12 +131,14 @@ export declare class ButtonsEventManager {
104
131
  * This modal is used while doing turbo spin
105
132
  * @public
106
133
  * @param {("flex" | "none")} displayValue - flag for displaying modal
134
+ * @returns {void}
107
135
  */
108
136
  setSpeedPopupVisibility(displayValue: "flex" | "none"): void;
109
137
  /**
110
138
  * Function for handling autostart conformation
111
139
  * @public
112
140
  * @param {() => void} confirmAutoplayButtonCallback - callback for confirming autoplay
141
+ * @returns {void}
113
142
  */
114
143
  setConfirmAutoplayButton(confirmAutoplayButtonCallback: () => void): void;
115
144
  /**
@@ -129,6 +158,7 @@ export declare class ButtonsEventManager {
129
158
  * Function for displaying modal layer with given name
130
159
  * @private
131
160
  * @param {string} layerName - name of layer
161
+ * @returns {void}
132
162
  */
133
163
  private handleModalInvocation;
134
164
  /**