pixi-rainman-game-engine 0.3.0 → 0.3.2

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 (186) 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 +3 -4
  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/appConfig.js +1 -0
  9. package/dist/Rainman/types.d.ts +1 -0
  10. package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.d.ts +4 -0
  11. package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.js +4 -0
  12. package/dist/SettingsUI/hooks/useDeviceOrientations.d.ts +4 -0
  13. package/dist/SettingsUI/hooks/useDeviceOrientations.js +4 -0
  14. package/dist/application/ApiConfig/ApiConfig.d.ts +2 -1
  15. package/dist/application/ApiConfig/ApiConfig.js +3 -2
  16. package/dist/application/ApiConfig/SymbolId.d.ts +1 -1
  17. package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +42 -5
  18. package/dist/application/ButtonsEventManager/ButtonsEventManager.js +51 -9
  19. package/dist/application/SoundManager/SoundManager.d.ts +26 -1
  20. package/dist/application/SoundManager/SoundManager.js +30 -2
  21. package/dist/application/SpeedState/SpeedAdapter.d.ts +9 -0
  22. package/dist/application/SpeedState/SpeedAdapter.js +9 -0
  23. package/dist/application/SpeedState/SpeedLevel.d.ts +42 -0
  24. package/dist/application/SpeedState/SpeedLevel.js +30 -0
  25. package/dist/application/SpeedState/SpeedLevelHandler.d.ts +7 -0
  26. package/dist/application/SpeedState/SpeedLevelHandler.js +7 -0
  27. package/dist/application/SpinLogic/SpinLogic.d.ts +58 -0
  28. package/dist/application/SpinLogic/SpinLogic.js +58 -0
  29. package/dist/application/SpinLogic/SpinLogicDTO.d.ts +70 -0
  30. package/dist/application/SpinLogic/SpinLogicDTO.js +70 -0
  31. package/dist/application/SpinLogic/WinScenarios.d.ts +12 -0
  32. package/dist/application/SpinLogic/WinScenarios.js +12 -0
  33. package/dist/application/SpinLogic/types.d.ts +10 -0
  34. package/dist/application/TimedActions/IncentiveComponent.d.ts +10 -0
  35. package/dist/application/TimedActions/IncentiveComponent.js +9 -1
  36. package/dist/application/TimedActions/TimedIncentiveController.d.ts +37 -0
  37. package/dist/application/TimedActions/TimedIncentiveController.js +37 -0
  38. package/dist/application/setup.d.ts +0 -1
  39. package/dist/application/setup.js +0 -1
  40. package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.d.ts +36 -1
  41. package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.js +25 -0
  42. package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +83 -2
  43. package/dist/components/AbstractMainContainer/AbstractMainContainer.js +97 -11
  44. package/dist/components/DoubleBorderText/DoubleBorderText.d.ts +10 -0
  45. package/dist/components/DoubleBorderText/DoubleBorderText.js +24 -0
  46. package/dist/components/DoubleBorderText/index.d.ts +1 -0
  47. package/dist/components/DoubleBorderText/index.js +1 -0
  48. package/dist/components/GambleGame/GambleGame.d.ts +39 -0
  49. package/dist/components/GambleGame/GambleGame.js +44 -3
  50. package/dist/components/GambleGame/types.d.ts +5 -0
  51. package/dist/components/buttons/BaseButton/BaseButton.d.ts +73 -2
  52. package/dist/components/buttons/BaseButton/BaseButton.js +73 -2
  53. package/dist/components/buttons/BaseButton/types.d.ts +5 -0
  54. package/dist/components/buttons/buttonGroups/LeftButtons.d.ts +11 -0
  55. package/dist/components/buttons/buttonGroups/LeftButtons.js +11 -0
  56. package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.d.ts +13 -1
  57. package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.js +13 -1
  58. package/dist/components/buttons/buttonGroups/LeftButtonsMobile.d.ts +19 -1
  59. package/dist/components/buttons/buttonGroups/LeftButtonsMobile.js +19 -1
  60. package/dist/components/buttons/buttonGroups/MiddleButtons.d.ts +27 -2
  61. package/dist/components/buttons/buttonGroups/MiddleButtons.js +46 -3
  62. package/dist/components/buttons/buttonGroups/RightButtons.d.ts +19 -3
  63. package/dist/components/buttons/buttonGroups/RightButtons.js +29 -1
  64. package/dist/components/buttons/buttonGroups/RightButtonsLandscape.d.ts +11 -0
  65. package/dist/components/buttons/buttonGroups/RightButtonsLandscape.js +11 -0
  66. package/dist/components/buttons/buttonGroups/RightButtonsMobile.d.ts +17 -0
  67. package/dist/components/buttons/buttonGroups/RightButtonsMobile.js +17 -0
  68. package/dist/components/buttons/default/AutoplayButton.d.ts +6 -0
  69. package/dist/components/buttons/default/AutoplayButton.js +8 -1
  70. package/dist/components/buttons/default/GambleButton.d.ts +13 -0
  71. package/dist/components/buttons/default/GambleButton.js +43 -0
  72. package/dist/components/buttons/default/RefreshButton.d.ts +30 -0
  73. package/dist/components/buttons/default/RefreshButton.js +36 -3
  74. package/dist/components/buttons/default/SpeedControlButton.d.ts +2 -0
  75. package/dist/components/buttons/default/SpeedControlButton.js +2 -0
  76. package/dist/components/buttons/default/TakeButton.d.ts +13 -0
  77. package/dist/components/buttons/default/TakeButton.js +37 -0
  78. package/dist/components/buttons/default/VolumeButton.d.ts +2 -0
  79. package/dist/components/buttons/default/VolumeButton.js +2 -0
  80. package/dist/components/buttons/default/index.d.ts +2 -0
  81. package/dist/components/buttons/default/index.js +2 -0
  82. package/dist/components/buttons/registrynames.d.ts +2 -0
  83. package/dist/components/buttons/registrynames.js +3 -1
  84. package/dist/components/common/AnimatedBackground.d.ts +22 -0
  85. package/dist/components/common/AnimatedBackground.js +22 -0
  86. package/dist/components/common/AnimatedNumber.d.ts +36 -0
  87. package/dist/components/common/AnimatedNumber.js +36 -0
  88. package/dist/components/common/Background.d.ts +20 -0
  89. package/dist/components/common/Background.js +22 -1
  90. package/dist/components/common/FreeSpinButton.d.ts +33 -1
  91. package/dist/components/common/FreeSpinButton.js +37 -4
  92. package/dist/components/common/IResizableContainer.d.ts +4 -0
  93. package/dist/components/common/Logo.d.ts +21 -0
  94. package/dist/components/common/Logo.js +21 -0
  95. package/dist/components/common/LogoStatic.d.ts +10 -0
  96. package/dist/components/common/LogoStatic.js +10 -0
  97. package/dist/components/common/ResponsiveComponent.d.ts +22 -0
  98. package/dist/components/common/ResponsiveComponent.js +10 -0
  99. package/dist/components/common/ResumableContainers.d.ts +6 -0
  100. package/dist/components/common/ResumableContainers.js +6 -0
  101. package/dist/components/common/ScalableSpine.d.ts +11 -0
  102. package/dist/components/common/ScalableSpine.js +11 -0
  103. package/dist/components/frame/AbstractColumnsContainer.d.ts +20 -6
  104. package/dist/components/frame/AbstractColumnsContainer.js +18 -4
  105. package/dist/components/frame/AbstractFrame.d.ts +115 -0
  106. package/dist/components/frame/AbstractFrame.js +97 -2
  107. package/dist/components/frame/AbstractInnerFrame.d.ts +5 -0
  108. package/dist/components/frame/AbstractInnerFrame.js +5 -0
  109. package/dist/components/frame/WinLineAnimation.d.ts +10 -0
  110. package/dist/components/frame/WinLineAnimation.js +12 -1
  111. package/dist/components/frame/constants.d.ts +7 -0
  112. package/dist/components/frame/constants.js +3 -0
  113. package/dist/components/index.d.ts +1 -0
  114. package/dist/components/index.js +1 -0
  115. package/dist/components/messageBox/MessageBox.d.ts +33 -0
  116. package/dist/components/messageBox/MessageBox.js +34 -1
  117. package/dist/components/symbols/AbstractSymbolBase.d.ts +146 -2
  118. package/dist/components/symbols/AbstractSymbolBase.js +137 -14
  119. package/dist/components/symbols/AbstractSymbolsColumn.d.ts +233 -3
  120. package/dist/components/symbols/AbstractSymbolsColumn.js +220 -10
  121. package/dist/components/symbols/DroppableSymbol.d.ts +16 -0
  122. package/dist/components/symbols/DroppableSymbol.js +16 -0
  123. package/dist/components/symbols/DroppableSymbolsColumn.d.ts +51 -0
  124. package/dist/components/symbols/DroppableSymbolsColumn.js +57 -3
  125. package/dist/components/symbols/types.d.ts +8 -0
  126. package/dist/components/symbols/types.js +4 -0
  127. package/dist/components/updatable/GambleUpdatableText.d.ts +5 -0
  128. package/dist/components/updatable/GambleUpdatableText.js +5 -0
  129. package/dist/components/updatable/StylefulUpdatableText.d.ts +23 -0
  130. package/dist/components/updatable/StylefulUpdatableText.js +25 -1
  131. package/dist/components/updatable/UpdatableValueComponent.d.ts +71 -0
  132. package/dist/components/updatable/UpdatableValueComponent.js +77 -4
  133. package/dist/connectivity/ConnectionWrapper.d.ts +20 -1
  134. package/dist/connectivity/ConnectionWrapper.js +23 -3
  135. package/dist/connectivity/LocalConnectionWrapper.d.ts +2 -2
  136. package/dist/connectivity/LocalConnectionWrapper.js +2 -2
  137. package/dist/connectivity/serverConnection.d.ts +59 -0
  138. package/dist/connectivity/serverData.d.ts +3 -1
  139. package/dist/connectivity/spinData.d.ts +15 -0
  140. package/dist/connectivity/spinData.js +15 -0
  141. package/dist/constants/gamePhase.d.ts +4 -0
  142. package/dist/controllers/AbstractController.d.ts +114 -5
  143. package/dist/controllers/AbstractController.js +180 -37
  144. package/dist/controllers/QuickStopController.d.ts +3 -0
  145. package/dist/controllers/QuickStopController.js +3 -0
  146. package/dist/controllers/UiController.d.ts +163 -1
  147. package/dist/controllers/UiController.js +170 -5
  148. package/dist/errors/LanguageNotDefinedError.d.ts +4 -0
  149. package/dist/errors/LanguageNotDefinedError.js +4 -0
  150. package/dist/errors/SpineDataNotFound.d.ts +4 -0
  151. package/dist/errors/SpineDataNotFound.js +4 -0
  152. package/dist/errors/TextureNotFound.d.ts +4 -0
  153. package/dist/errors/TextureNotFound.js +4 -0
  154. package/dist/loading/AbstractLoadingContainer.d.ts +16 -0
  155. package/dist/loading/AbstractLoadingContainer.js +16 -0
  156. package/dist/loading/SpriteLoadingContainer.d.ts +18 -0
  157. package/dist/loading/SpriteLoadingContainer.js +18 -0
  158. package/dist/localStorage/localStorage.d.ts +23 -0
  159. package/dist/localStorage/localStorage.js +19 -0
  160. package/dist/stores/SettingsStore.d.ts +276 -4
  161. package/dist/stores/SettingsStore.js +309 -14
  162. package/dist/stores/types.d.ts +4 -0
  163. package/dist/utils/assets/assetGetter.js +6 -3
  164. package/dist/utils/common/deviceOrientation.js +2 -1
  165. package/dist/utils/common/functions.d.ts +57 -1
  166. package/dist/utils/common/functions.js +63 -4
  167. package/dist/utils/common/logger.js +4 -2
  168. package/dist/utils/common/placementHelpers.d.ts +14 -0
  169. package/dist/utils/common/placementHelpers.js +20 -1
  170. package/dist/utils/common/screenHelpers.d.ts +28 -0
  171. package/dist/utils/common/screenHelpers.js +34 -3
  172. package/dist/utils/common/sound.d.ts +1 -0
  173. package/dist/utils/common/sound.js +2 -0
  174. package/dist/utils/common/stats.d.ts +1 -0
  175. package/dist/utils/common/stats.js +2 -0
  176. package/dist/winComponents/AnimableParticlesEmitter.d.ts +6 -0
  177. package/dist/winComponents/AnimableParticlesEmitter.js +6 -0
  178. package/dist/winComponents/BaseWinContainer.d.ts +64 -0
  179. package/dist/winComponents/BaseWinContainer.js +66 -1
  180. package/dist/winComponents/PositioningFrame.d.ts +7 -0
  181. package/dist/winComponents/PositioningFrame.js +7 -0
  182. package/dist/winComponents/TexturedText.d.ts +23 -0
  183. package/dist/winComponents/TexturedText.js +23 -0
  184. package/dist/winComponents/UpdatableSpineContainer.d.ts +25 -0
  185. package/dist/winComponents/UpdatableSpineContainer.js +25 -0
  186. package/package.json +1 -1
@@ -2,6 +2,7 @@ import { ResponsiveContainer } from "../../common";
2
2
  import { InfoButton, MoreButton, NegButton, SpeedControlButton, VolumeButton } from "../default";
3
3
  /**
4
4
  * Buttons for mobile landscape. It has a settings button and game information button.
5
+ * @augments {ResponsiveContainer}
5
6
  */
6
7
  export declare class RightButtonsLandscape extends ResponsiveContainer {
7
8
  protected readonly moreButton: MoreButton;
@@ -10,6 +11,16 @@ export declare class RightButtonsLandscape extends ResponsiveContainer {
10
11
  protected readonly negButton: NegButton;
11
12
  protected readonly speedControlButton: SpeedControlButton;
12
13
  constructor();
14
+ /**
15
+ * Function for removing children from the registry.
16
+ * @public
17
+ * @returns {void}
18
+ */
13
19
  removeChildrenFromRegistry(): void;
20
+ /**
21
+ * Function for repositioning the container.
22
+ * @protected
23
+ * @returns {void}
24
+ */
14
25
  protected reposition(): void;
15
26
  }
@@ -6,6 +6,7 @@ import { REGISTRY } from "../registrynames";
6
6
  import { MOBILE_BUTTONS_GAP, MOBILE_PANEL_BUTTON_SCALE, MOBILE_X_OFFSET, MOBILE_Y_BOTTOM_OFFSET } from "./constants";
7
7
  /**
8
8
  * Buttons for mobile landscape. It has a settings button and game information button.
9
+ * @augments {ResponsiveContainer}
9
10
  */
10
11
  export class RightButtonsLandscape extends ResponsiveContainer {
11
12
  moreButton = new MoreButton(true);
@@ -34,6 +35,11 @@ export class RightButtonsLandscape extends ResponsiveContainer {
34
35
  ]);
35
36
  this.resize();
36
37
  }
38
+ /**
39
+ * Function for removing children from the registry.
40
+ * @public
41
+ * @returns {void}
42
+ */
37
43
  removeChildrenFromRegistry() {
38
44
  RainMan.componentRegistry.removeMany([
39
45
  this.moreButton,
@@ -43,6 +49,11 @@ export class RightButtonsLandscape extends ResponsiveContainer {
43
49
  this.speedControlButton
44
50
  ]);
45
51
  }
52
+ /**
53
+ * Function for repositioning the container.
54
+ * @protected
55
+ * @returns {void}
56
+ */
46
57
  reposition() {
47
58
  this.y = RainMan.app.screen.height;
48
59
  this.x = RainMan.app.screen.width;
@@ -4,6 +4,7 @@ import { UpdatableTextComponent } from "../../updatable";
4
4
  import { InfoButton, NegButton, SpeedControlButton } from "../default";
5
5
  /**
6
6
  * Buttons for mobile version. It has a current bet and game information button.
7
+ * @augments {ResponsiveContainer}
7
8
  */
8
9
  export declare class RightButtonsMobile extends ResponsiveContainer {
9
10
  protected readonly infoButton: InfoButton;
@@ -11,7 +12,23 @@ export declare class RightButtonsMobile extends ResponsiveContainer {
11
12
  protected readonly speedControlButton: SpeedControlButton;
12
13
  protected bet: UpdatableTextComponent;
13
14
  constructor();
15
+ /**
16
+ * Function for removing children from the registry.
17
+ * @public
18
+ * @returns {void}
19
+ */
14
20
  removeChildrenFromRegistry(): void;
21
+ /**
22
+ * Function for repositioning components on mobile screens.
23
+ * @protected
24
+ * @returns {void}
25
+ */
15
26
  protected reposition(): void;
27
+ /**
28
+ * Function for updating the bet text style.
29
+ * @public
30
+ * @param {Partial<ITextStyle>} style new style that we want to override
31
+ * @returns {void}
32
+ */
16
33
  updateBetStyle(style: Partial<ITextStyle>): void;
17
34
  }
@@ -8,6 +8,7 @@ import { COMPONENTS, REGISTRY } from "../registrynames";
8
8
  import { MOBILE_BUTTONS_GAP, MOBILE_PANEL_BUTTON_SCALE, MOBILE_X_OFFSET, MOBILE_Y_BOTTOM_OFFSET } from "./constants";
9
9
  /**
10
10
  * Buttons for mobile version. It has a current bet and game information button.
11
+ * @augments {ResponsiveContainer}
11
12
  */
12
13
  export class RightButtonsMobile extends ResponsiveContainer {
13
14
  infoButton = new InfoButton(true);
@@ -28,9 +29,19 @@ export class RightButtonsMobile extends ResponsiveContainer {
28
29
  RainMan.componentRegistry.addMany([this.infoButton, this.bet, this.negButton, this.speedControlButton]);
29
30
  this.resize();
30
31
  }
32
+ /**
33
+ * Function for removing children from the registry.
34
+ * @public
35
+ * @returns {void}
36
+ */
31
37
  removeChildrenFromRegistry() {
32
38
  RainMan.componentRegistry.removeMany([this.infoButton, this.bet, this.negButton, this.speedControlButton]);
33
39
  }
40
+ /**
41
+ * Function for repositioning components on mobile screens.
42
+ * @protected
43
+ * @returns {void}
44
+ */
34
45
  reposition() {
35
46
  this.y = RainMan.app.screen.height;
36
47
  this.x = RainMan.app.screen.width;
@@ -39,6 +50,12 @@ export class RightButtonsMobile extends ResponsiveContainer {
39
50
  this.bet.y = MOBILE_Y_BOTTOM_OFFSET;
40
51
  this.bet.x = this.infoButton.x + this.infoButton.width + MOBILE_BUTTONS_GAP;
41
52
  }
53
+ /**
54
+ * Function for updating the bet text style.
55
+ * @public
56
+ * @param {Partial<ITextStyle>} style new style that we want to override
57
+ * @returns {void}
58
+ */
42
59
  updateBetStyle(style) {
43
60
  this.bet.updateBaseTextStyle(style);
44
61
  }
@@ -16,5 +16,11 @@ export declare class AutoplayButton extends BaseButton {
16
16
  private mobile;
17
17
  static readonly registryName = "autoplayButton";
18
18
  constructor(mobile?: boolean);
19
+ /**
20
+ * Function for switching the button texture
21
+ * @public
22
+ * @param {keyof typeof ButtonStates} state - The state to switch to
23
+ * @returns {void}
24
+ */
19
25
  switchTexture(state: keyof typeof ButtonStates): void;
20
26
  }
@@ -39,10 +39,17 @@ export class AutoplayButton extends BaseButton {
39
39
  this.mobile = mobile;
40
40
  this.clickSound = SoundTracks.deactivationAutostart;
41
41
  }
42
+ /**
43
+ * Function for switching the button texture
44
+ * @public
45
+ * @param {keyof typeof ButtonStates} state - The state to switch to
46
+ * @returns {void}
47
+ */
42
48
  switchTexture(state) {
43
49
  super.switchTexture(state);
44
- if (this.mobile)
50
+ if (this.mobile) {
45
51
  return;
52
+ }
46
53
  if (state === ButtonStates.ACTIVE ||
47
54
  state === ButtonStates.ACTIVE_OVER ||
48
55
  state === ButtonStates.ACTIVE_CLICKED) {
@@ -0,0 +1,13 @@
1
+ import { BaseButton } from "../BaseButton";
2
+ /**
3
+ * Class for a Gamble button in the game.
4
+ * Textures names should be "gamble.png", "gamble-over.png", and "gamble-clicked.png".
5
+ * @class TakeButton
6
+ * @augments {BaseButton}
7
+ */
8
+ export declare class GambleButton extends BaseButton {
9
+ static readonly registryName = "gambleButton";
10
+ private mobile;
11
+ constructor(mobile?: boolean);
12
+ flipDisabledFlag(disabled: boolean): void;
13
+ }
@@ -0,0 +1,43 @@
1
+ import { RainMan } from "../../../Rainman";
2
+ import { getTexture } from "../../../utils";
3
+ import { BaseButton, ButtonStates } from "../BaseButton";
4
+ import { BUTTONS } from "../registrynames";
5
+ /**
6
+ * Class for a Gamble button in the game.
7
+ * Textures names should be "gamble.png", "gamble-over.png", and "gamble-clicked.png".
8
+ * @class TakeButton
9
+ * @augments {BaseButton}
10
+ */
11
+ export class GambleButton extends BaseButton {
12
+ static registryName = "gambleButton";
13
+ mobile;
14
+ constructor(mobile = false) {
15
+ const textureMap = mobile
16
+ ? {
17
+ [ButtonStates.NORMAL]: getTexture("mobile-gamble.png")
18
+ }
19
+ : {
20
+ [ButtonStates.NORMAL]: getTexture("gamble.png"),
21
+ [ButtonStates.OVER]: getTexture("gamble-over.png"),
22
+ [ButtonStates.CLICKED]: getTexture("gamble-clicked.png")
23
+ };
24
+ super(GambleButton.registryName, textureMap);
25
+ this.mobile = mobile;
26
+ }
27
+ flipDisabledFlag(disabled) {
28
+ super.flipDisabledFlag(disabled);
29
+ this.alpha = disabled ? 0 : 1;
30
+ if (!disabled && this.mobile) {
31
+ RainMan.componentRegistry.get(BUTTONS.autoplay).alpha = 0;
32
+ }
33
+ else {
34
+ RainMan.componentRegistry.get(BUTTONS.autoplay).alpha = 1;
35
+ }
36
+ if (!disabled && !this.mobile) {
37
+ RainMan.componentRegistry.get(BUTTONS.neg).alpha = 0;
38
+ }
39
+ else {
40
+ RainMan.componentRegistry.get(BUTTONS.neg).alpha = 1;
41
+ }
42
+ }
43
+ }
@@ -25,9 +25,39 @@ export declare class RefreshButton extends BaseButton implements IncentiveCompon
25
25
  private readonly arrowsSprite;
26
26
  private readonly stopSprite;
27
27
  constructor(mobile?: boolean);
28
+ /**
29
+ * Function for activating the button.
30
+ * @public
31
+ * @param {boolean} flag flag for activating
32
+ * @returns {void}
33
+ */
28
34
  activate(flag: boolean): void;
35
+ /**
36
+ * Function for animating the button.
37
+ * @public
38
+ * @returns {void}
39
+ */
29
40
  animate(): void;
41
+ /**
42
+ * Function for initializing the incentive action.
43
+ * @public
44
+ * @param {Record<string, boolean>} incentiveJobFlag flags for incentive jobs
45
+ * @param {() => void} afterAllDoneCallback callback for after all incentive jobs are done
46
+ * @returns {void}
47
+ */
30
48
  initIncentiveAction(incentiveJobFlag: Record<string, boolean>, afterAllDoneCallback: () => void): void;
49
+ /**
50
+ * Function for switching the button texture.
51
+ * @protected
52
+ * @param {keyof typeof ButtonStates} state state of the button
53
+ * @returns {void}
54
+ */
31
55
  protected switchTexture(state: keyof typeof ButtonStates): void;
56
+ /**
57
+ * Updates the arrows sprite texture based on the refresh button texture.
58
+ * @private
59
+ * @param {Texture} refreshButtonTexture new texture for refresh button
60
+ * @returns {void}
61
+ */
32
62
  private updateArrowsSprite;
33
63
  }
@@ -57,18 +57,38 @@ export class RefreshButton extends BaseButton {
57
57
  this.hitArea = new Circle(this.arrowsSprite.x, this.arrowsSprite.y - 5, this.arrowsSprite.width / 2 + 40);
58
58
  }
59
59
  }
60
+ /**
61
+ * Function for activating the button.
62
+ * @public
63
+ * @param {boolean} flag flag for activating
64
+ * @returns {void}
65
+ */
60
66
  activate(flag) {
61
67
  super.activate(flag);
62
- if (this.arrowsSprite)
68
+ if (this.arrowsSprite) {
63
69
  this.arrowsSprite.visible = !flag;
64
- if (this.stopSprite)
70
+ }
71
+ if (this.stopSprite) {
65
72
  this.stopSprite.visible = flag;
73
+ }
66
74
  }
75
+ /**
76
+ * Function for animating the button.
77
+ * @public
78
+ * @returns {void}
79
+ */
67
80
  animate() {
68
81
  if (this.spinTween !== null) {
69
82
  this.spinTween.update(RainMan.app.ticker.lastTime);
70
83
  }
71
84
  }
85
+ /**
86
+ * Function for initializing the incentive action.
87
+ * @public
88
+ * @param {Record<string, boolean>} incentiveJobFlag flags for incentive jobs
89
+ * @param {() => void} afterAllDoneCallback callback for after all incentive jobs are done
90
+ * @returns {void}
91
+ */
72
92
  initIncentiveAction(incentiveJobFlag, afterAllDoneCallback) {
73
93
  const fullRotation = (2 * (360 * Math.PI)) / 180;
74
94
  this.spinTween = new TWEEN.Tween({
@@ -98,15 +118,28 @@ export class RefreshButton extends BaseButton {
98
118
  }
99
119
  });
100
120
  }
121
+ /**
122
+ * Function for switching the button texture.
123
+ * @protected
124
+ * @param {keyof typeof ButtonStates} state state of the button
125
+ * @returns {void}
126
+ */
101
127
  switchTexture(state) {
102
128
  if (this.textures[state]) {
103
129
  this.texture = this.textures[state];
104
130
  this.updateArrowsSprite(this.texture);
105
131
  }
106
132
  }
133
+ /**
134
+ * Updates the arrows sprite texture based on the refresh button texture.
135
+ * @private
136
+ * @param {Texture} refreshButtonTexture new texture for refresh button
137
+ * @returns {void}
138
+ */
107
139
  updateArrowsSprite(refreshButtonTexture) {
108
- if (!this.arrowsSprite)
140
+ if (!this.arrowsSprite) {
109
141
  return;
142
+ }
110
143
  const textureStatePrefix = refreshButtonTexture.textureCacheIds[0].split("/")[0];
111
144
  this.arrowsSprite.texture = getTexture(`${textureStatePrefix}/arrows.png`);
112
145
  }
@@ -14,7 +14,9 @@ export declare class SpeedControlButton extends BaseButton implements SpeedAdapt
14
14
  constructor();
15
15
  /**
16
16
  * Change button's texture according to speed level
17
+ * @public
17
18
  * @param {SpeedLevel} speedLevel - new speed level
19
+ * @returns {void}
18
20
  */
19
21
  adaptToSpeed(speedLevel: SpeedLevel): void;
20
22
  }
@@ -28,7 +28,9 @@ export class SpeedControlButton extends BaseButton {
28
28
  }
29
29
  /**
30
30
  * Change button's texture according to speed level
31
+ * @public
31
32
  * @param {SpeedLevel} speedLevel - new speed level
33
+ * @returns {void}
32
34
  */
33
35
  adaptToSpeed(speedLevel) {
34
36
  this.setTextureMap(this.speedLevelMapper[speedLevel]);
@@ -0,0 +1,13 @@
1
+ import { BaseButton } from "../BaseButton";
2
+ /**
3
+ * Class for a Take button in the game.
4
+ * Textures names should be "take.png", "take-over.png", and "take-clicked.png".
5
+ * @class TakeButton
6
+ * @augments {BaseButton}
7
+ */
8
+ export declare class TakeButton extends BaseButton {
9
+ static readonly registryName = "takeButton";
10
+ private mobile;
11
+ constructor(mobile?: boolean);
12
+ flipDisabledFlag(disabled: boolean): void;
13
+ }
@@ -0,0 +1,37 @@
1
+ import { RainMan } from "../../../Rainman";
2
+ import { getTexture } from "../../../utils";
3
+ import { BaseButton, ButtonStates } from "../BaseButton";
4
+ import { BUTTONS } from "../registrynames";
5
+ /**
6
+ * Class for a Take button in the game.
7
+ * Textures names should be "take.png", "take-over.png", and "take-clicked.png".
8
+ * @class TakeButton
9
+ * @augments {BaseButton}
10
+ */
11
+ export class TakeButton extends BaseButton {
12
+ static registryName = "takeButton";
13
+ mobile;
14
+ constructor(mobile = false) {
15
+ const textureMap = mobile
16
+ ? {
17
+ [ButtonStates.NORMAL]: getTexture("mobile-take.png")
18
+ }
19
+ : {
20
+ [ButtonStates.NORMAL]: getTexture("take.png"),
21
+ [ButtonStates.OVER]: getTexture("take-over.png"),
22
+ [ButtonStates.CLICKED]: getTexture("take-clicked.png")
23
+ };
24
+ super(TakeButton.registryName, textureMap);
25
+ this.mobile = mobile;
26
+ }
27
+ flipDisabledFlag(disabled) {
28
+ super.flipDisabledFlag(disabled);
29
+ this.alpha = disabled ? 0 : 1;
30
+ if (!disabled) {
31
+ RainMan.componentRegistry.get(BUTTONS.plus).alpha = 0;
32
+ }
33
+ else {
34
+ RainMan.componentRegistry.get(BUTTONS.plus).alpha = 1;
35
+ }
36
+ }
37
+ }
@@ -18,6 +18,8 @@ export declare class VolumeButton extends BaseButton {
18
18
  constructor();
19
19
  /**
20
20
  * Changes volume texture based on volume between `MUTED` and `NORMAL`
21
+ * @public
22
+ * @returns {void}
21
23
  */
22
24
  changeTextureDependOnVolume(): void;
23
25
  }
@@ -34,6 +34,8 @@ export class VolumeButton extends BaseButton {
34
34
  }
35
35
  /**
36
36
  * Changes volume texture based on volume between `MUTED` and `NORMAL`
37
+ * @public
38
+ * @returns {void}
37
39
  */
38
40
  changeTextureDependOnVolume() {
39
41
  if (RainMan.settingsStore.isSoundEnabled()) {
@@ -1,6 +1,7 @@
1
1
  export * from "./AutoplayButton";
2
2
  export * from "./BlackButton";
3
3
  export * from "./CollectButton";
4
+ export * from "./GambleButton";
4
5
  export * from "./InfoButton";
5
6
  export * from "./MoreButton";
6
7
  export * from "./NegButton";
@@ -9,4 +10,5 @@ export * from "./RedButton";
9
10
  export * from "./RefreshButton";
10
11
  export * from "./SpeedControlButton";
11
12
  export * from "./SpinConfirmationButton";
13
+ export * from "./TakeButton";
12
14
  export * from "./VolumeButton";
@@ -1,6 +1,7 @@
1
1
  export * from "./AutoplayButton";
2
2
  export * from "./BlackButton";
3
3
  export * from "./CollectButton";
4
+ export * from "./GambleButton";
4
5
  export * from "./InfoButton";
5
6
  export * from "./MoreButton";
6
7
  export * from "./NegButton";
@@ -9,4 +10,5 @@ export * from "./RedButton";
9
10
  export * from "./RefreshButton";
10
11
  export * from "./SpeedControlButton";
11
12
  export * from "./SpinConfirmationButton";
13
+ export * from "./TakeButton";
12
14
  export * from "./VolumeButton";
@@ -9,7 +9,9 @@ export declare const BUTTONS: {
9
9
  readonly info: "infoButton";
10
10
  readonly more: "moreButton";
11
11
  readonly gamble: "gambleButton";
12
+ readonly take: "takeButton";
12
13
  readonly volume: "volumeButton";
14
+ readonly autoplay: "autoplayButton";
13
15
  };
14
16
  /**
15
17
  * Button groups in Rainman Registry
@@ -9,7 +9,9 @@ export const BUTTONS = {
9
9
  info: "infoButton",
10
10
  more: "moreButton",
11
11
  gamble: "gambleButton",
12
- volume: "volumeButton"
12
+ take: "takeButton",
13
+ volume: "volumeButton",
14
+ autoplay: "autoplayButton"
13
15
  };
14
16
  /**
15
17
  * Button groups in Rainman Registry
@@ -14,12 +14,18 @@ export declare class AnimatedBackground extends ResumableContainer {
14
14
  static readonly registryName = "animatedBackground";
15
15
  protected spine: Spine;
16
16
  constructor(desktopSpineName: string, animationName: string, mobileSpineName?: string);
17
+ /**
18
+ * Function for resizing the background.
19
+ * @public
20
+ * @returns {void}
21
+ */
17
22
  resize(): void;
18
23
  /**
19
24
  * This method is called when free spins are triggered
20
25
  * It is used to change the background animation
21
26
  * Remember to change resize for this method
22
27
  * @protected
28
+ * @returns {void}
23
29
  */
24
30
  protected changeForFreeSpins(): void;
25
31
  /**
@@ -27,9 +33,25 @@ export declare class AnimatedBackground extends ResumableContainer {
27
33
  * It is used to change the background animation
28
34
  * Remember to change resize for this method
29
35
  * @protected
36
+ * @returns {void}
30
37
  */
31
38
  protected changeForBaseGame(): void;
39
+ /**
40
+ * Function for setting the desktop background.
41
+ * @private
42
+ * @returns {void}
43
+ */
32
44
  private setDesktopBackground;
45
+ /**
46
+ * Function for setting the mobile background.
47
+ * @private
48
+ * @returns {void}
49
+ */
33
50
  private setMobileBackground;
51
+ /**
52
+ * Function for changing spines depending on device orientation.
53
+ * @private
54
+ * @returns {void}
55
+ */
34
56
  private changeSpineForOrientation;
35
57
  }
@@ -24,6 +24,11 @@ export class AnimatedBackground extends ResumableContainer {
24
24
  this.name = AnimatedBackground.registryName;
25
25
  this.parentLayer = BackgroundLayer;
26
26
  }
27
+ /**
28
+ * Function for resizing the background.
29
+ * @public
30
+ * @returns {void}
31
+ */
27
32
  resize() {
28
33
  this.changeSpineForOrientation();
29
34
  this.x = 0;
@@ -36,6 +41,7 @@ export class AnimatedBackground extends ResumableContainer {
36
41
  * It is used to change the background animation
37
42
  * Remember to change resize for this method
38
43
  * @protected
44
+ * @returns {void}
39
45
  */
40
46
  changeForFreeSpins() { }
41
47
  /**
@@ -43,16 +49,32 @@ export class AnimatedBackground extends ResumableContainer {
43
49
  * It is used to change the background animation
44
50
  * Remember to change resize for this method
45
51
  * @protected
52
+ * @returns {void}
46
53
  */
47
54
  changeForBaseGame() { }
55
+ /**
56
+ * Function for setting the desktop background.
57
+ * @private
58
+ * @returns {void}
59
+ */
48
60
  setDesktopBackground() {
49
61
  this.spine = new Spine(getSpineData(this.desktopSpineName));
50
62
  this.spine.state.setAnimation(0, this.animationName, true);
51
63
  }
64
+ /**
65
+ * Function for setting the mobile background.
66
+ * @private
67
+ * @returns {void}
68
+ */
52
69
  setMobileBackground() {
53
70
  this.spine = new Spine(getSpineData(this.mobileSpineName));
54
71
  this.spine.state.setAnimation(0, this.animationName, true);
55
72
  }
73
+ /**
74
+ * Function for changing spines depending on device orientation.
75
+ * @private
76
+ * @returns {void}
77
+ */
56
78
  changeSpineForOrientation() {
57
79
  this.removeChildren();
58
80
  getDeviceOrientation() === "mobile-portrait" ? this.setMobileBackground() : this.setDesktopBackground();
@@ -3,16 +3,52 @@ import { Spine } from "pixi-spine";
3
3
  /**
4
4
  * Class representing animated number, based on spine animation.
5
5
  * Animation names should be exact the same as a represented symbol.
6
+ * This class is used in games like: LDE, LP, POBJ, POBWW, 5CC, 20CC and RC5.
7
+ * This represents the value of wins in this games in e.g. super bonus game (LDE, LP)
8
+ * and total win in free spin game (5CC, 20CC, RC5).
9
+ * @class AnimatedNumber
10
+ * @augments {Container}
6
11
  */
7
12
  export declare class AnimatedNumber extends Container {
8
13
  spineName: string;
9
14
  number: number | string;
10
15
  digits: Spine[];
11
16
  constructor(spineName: string, number: number | string);
17
+ /**
18
+ * Function for setting position of digits in row
19
+ * @private
20
+ * @returns {void}
21
+ */
12
22
  private setDigits;
23
+ /**
24
+ * Function for setting move animation for digits.
25
+ * @public
26
+ * @returns {void}
27
+ */
13
28
  setMoveAnimation(): void;
29
+ /**
30
+ * Function for removing digits from the display.
31
+ * @public
32
+ * @returns {void}
33
+ */
14
34
  removeDigits(): void;
35
+ /**
36
+ * Getter for displayed value
37
+ * @public
38
+ * @returns {number | string} current displayed value
39
+ */
15
40
  get value(): number | string;
41
+ /**
42
+ * Setter for displayed value
43
+ * @public
44
+ * @param {number | string} value new displayed value
45
+ * @returns {void}
46
+ */
16
47
  set value(value: number | string);
48
+ /**
49
+ * Function for playing the animation.
50
+ * @public
51
+ * @returns {void}
52
+ */
17
53
  play(): void;
18
54
  }