pixi-rainman-game-engine 0.1.53 → 0.2.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 (52) hide show
  1. package/dist/DescribedPlayableAction/DescribedPlayableAction.d.ts +1 -1
  2. package/dist/DescribedPlayableAction/DescribedPlayableAction.js +1 -1
  3. package/dist/Rainman/Rainman.d.ts +10 -0
  4. package/dist/Rainman/Rainman.js +10 -0
  5. package/dist/Rainman/types.d.ts +1 -0
  6. package/dist/application/ApiConfig/SymbolId.d.ts +8 -0
  7. package/dist/application/ApiConfig/WinTypeId.d.ts +6 -0
  8. package/dist/application/SpinLogic/WinScenarios.d.ts +1 -1
  9. package/dist/application/SpinLogic/WinScenarios.js +1 -1
  10. package/dist/components/buttons/BaseButton/ButtonState.d.ts +11 -0
  11. package/dist/components/buttons/BaseButton/ButtonState.js +11 -0
  12. package/dist/components/common/AnimatedNumber.d.ts +4 -0
  13. package/dist/components/common/AnimatedNumber.js +4 -0
  14. package/dist/components/common/ResumableContainers.d.ts +1 -1
  15. package/dist/components/common/ResumableContainers.js +1 -1
  16. package/dist/components/frame/AbstractColumnsContainer.js +0 -3
  17. package/dist/components/frame/AbstractFrame.d.ts +16 -1
  18. package/dist/components/frame/AbstractFrame.js +16 -1
  19. package/dist/components/frame/AbstractInnerFrame.d.ts +1 -1
  20. package/dist/components/frame/AbstractInnerFrame.js +1 -1
  21. package/dist/components/symbols/AbstractSymbolBase.d.ts +1 -1
  22. package/dist/components/symbols/AbstractSymbolBase.js +1 -1
  23. package/dist/components/symbols/AbstractSymbolsColumn.d.ts +1 -2
  24. package/dist/components/symbols/AbstractSymbolsColumn.js +3 -7
  25. package/dist/components/symbols/DroppableSymbol.d.ts +1 -1
  26. package/dist/components/symbols/DroppableSymbol.js +1 -1
  27. package/dist/connectivity/ConnectionWrapper.js +1 -0
  28. package/dist/connectivity/serverData.d.ts +3 -0
  29. package/dist/connectivity/transformation.d.ts +3 -0
  30. package/dist/constants/gamePhase.d.ts +1 -1
  31. package/dist/constants/gamePhase.js +1 -1
  32. package/dist/constants/transformation.d.ts +3 -0
  33. package/dist/constants/transformation.js +3 -0
  34. package/dist/constants/wins.d.ts +3 -0
  35. package/dist/constants/wins.js +3 -0
  36. package/dist/controllers/AbstractController.d.ts +86 -3
  37. package/dist/controllers/AbstractController.js +104 -15
  38. package/dist/controllers/QuickStopController.d.ts +2 -1
  39. package/dist/controllers/QuickStopController.js +2 -1
  40. package/dist/controllers/UiController.d.ts +8 -0
  41. package/dist/controllers/UiController.js +8 -1
  42. package/dist/layers/layers.d.ts +16 -0
  43. package/dist/layers/layers.js +16 -0
  44. package/dist/stores/SettingsStore.d.ts +20 -0
  45. package/dist/stores/SettingsStore.js +20 -0
  46. package/dist/utils/common/functions.d.ts +18 -0
  47. package/dist/utils/common/functions.js +18 -0
  48. package/dist/utils/common/placementHelpers.d.ts +5 -0
  49. package/dist/utils/common/placementHelpers.js +5 -0
  50. package/dist/winComponents/AnimableParticlesEmitter.d.ts +1 -1
  51. package/dist/winComponents/AnimableParticlesEmitter.js +1 -1
  52. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { Nullable, PlayableAction } from "../utils";
2
2
  /**
3
- * Class representing a described playable action
3
+ * Class representing a described playable action in action queue.
4
4
  */
5
5
  export declare class DescribedPlayableAction<T> {
6
6
  readonly type: T;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Class representing a described playable action
2
+ * Class representing a described playable action in action queue.
3
3
  */
4
4
  export class DescribedPlayableAction {
5
5
  type;
@@ -4,6 +4,16 @@ import { SymbolIds, WinTypeIds } from "../application";
4
4
  import { ComponentRegistry } from "../ComponentRegistry";
5
5
  import { SettingsStore } from "../stores";
6
6
  import { AppConfig, Globals, OptionalAppConfig, RequiredAppConfig } from "./types";
7
+ /**
8
+ * This class represents Pixi application. Before initializing game, user has to configure following:
9
+ * - {@link Application}
10
+ * - {@link RequiredAppConfig} and {@link OptionalAppConfig}
11
+ * - {@link SymbolIds} present in `gameEngineConfig`
12
+ * - {@link WinTypeIds} present in `gameEngineConfig`
13
+ *
14
+ * @export
15
+ * @class RainMan
16
+ */
7
17
  export declare class RainMan {
8
18
  static app: Application;
9
19
  static config: RequiredAppConfig & OptionalAppConfig;
@@ -4,6 +4,16 @@ import { Currencies } from "ts-money";
4
4
  import { ComponentRegistry } from "../ComponentRegistry";
5
5
  import { settingStore } from "../SettingsUI/hooks";
6
6
  import { defaultAppConfig } from "./appConfig";
7
+ /**
8
+ * This class represents Pixi application. Before initializing game, user has to configure following:
9
+ * - {@link Application}
10
+ * - {@link RequiredAppConfig} and {@link OptionalAppConfig}
11
+ * - {@link SymbolIds} present in `gameEngineConfig`
12
+ * - {@link WinTypeIds} present in `gameEngineConfig`
13
+ *
14
+ * @export
15
+ * @class RainMan
16
+ */
7
17
  export class RainMan {
8
18
  static app;
9
19
  static config;
@@ -65,6 +65,7 @@ export type AppConfig = RequiredAppConfig & DeepPartial<OptionalAppConfig>;
65
65
  */
66
66
  export interface Globals {
67
67
  currency: Currency;
68
+ actionsAfterClosureWebSocket?: () => void;
68
69
  disableSpeedPopup?: (value: boolean) => void;
69
70
  handleDisablingButtons?: (value?: boolean) => void;
70
71
  throttledSpin?: () => void;
@@ -2,6 +2,14 @@
2
2
  * Interface for specifying symbols in game
3
3
  * This type can be modified for each game in engine.d.ts file
4
4
  *
5
+ * @example
6
+ * ```
7
+ * interface SymbolIds {
8
+ * cherries: "cherries",
9
+ * lemon: "lemon",
10
+ * }
11
+ * ```
12
+ *
5
13
  * @export
6
14
  * @interface SymbolIds
7
15
  * @typedef {SymbolIds}
@@ -1,6 +1,12 @@
1
1
  /**
2
2
  * Interface for specifying win in game
3
3
  * This type can be modified for each game in engine.d.ts file
4
+ * @example
5
+ * ```
6
+ * interface WinTypeIds {
7
+ * streak: "streak";
8
+ * }
9
+ * ```
4
10
  *
5
11
  * @export
6
12
  * @interface WinTypeIds
@@ -1,6 +1,6 @@
1
1
  import { TransformationDetails, Win } from "../../connectivity";
2
2
  /**
3
- * This class represents win scenarios
3
+ * This class represents win and transformation scenarios described in {@link transformationTypes} and {@link PossibleWins}
4
4
  *
5
5
  * @exports {WinScenarios}
6
6
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This class represents win scenarios
2
+ * This class represents win and transformation scenarios described in {@link transformationTypes} and {@link PossibleWins}
3
3
  *
4
4
  * @exports {WinScenarios}
5
5
  */
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Describes all button states in game
3
+ *@example
4
+ * ```
5
+ * const textureMap = {
6
+ * [ButtonStates.NORMAL]: getTexture("continueButton-normal.png"),
7
+ * [ButtonStates.CLICKED]: getTexture("continueButton-clicked.png"),
8
+ * [ButtonStates.OVER]: getTexture("continueButton-hover.png"),
9
+ * } as TextureMap;
10
+ * ```
11
+ */
1
12
  export declare const ButtonStates: {
2
13
  readonly NORMAL: "NORMAL";
3
14
  readonly OVER: "OVER";
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Describes all button states in game
3
+ *@example
4
+ * ```
5
+ * const textureMap = {
6
+ * [ButtonStates.NORMAL]: getTexture("continueButton-normal.png"),
7
+ * [ButtonStates.CLICKED]: getTexture("continueButton-clicked.png"),
8
+ * [ButtonStates.OVER]: getTexture("continueButton-hover.png"),
9
+ * } as TextureMap;
10
+ * ```
11
+ */
1
12
  export const ButtonStates = {
2
13
  NORMAL: "NORMAL",
3
14
  OVER: "OVER",
@@ -1,4 +1,8 @@
1
1
  import { Container } from "pixi.js";
2
+ /**
3
+ * Class representing animated number, based on spine animation.
4
+ * Animation names should be exact the same as a represented symbol.
5
+ */
2
6
  export declare class AnimatedNumber extends Container {
3
7
  private spineName;
4
8
  private number;
@@ -1,6 +1,10 @@
1
1
  import { Container } from "pixi.js";
2
2
  import { Spine } from "pixi-spine";
3
3
  import { getSpineData } from "../../utils";
4
+ /**
5
+ * Class representing animated number, based on spine animation.
6
+ * Animation names should be exact the same as a represented symbol.
7
+ */
4
8
  export class AnimatedNumber extends Container {
5
9
  spineName;
6
10
  number;
@@ -1,7 +1,7 @@
1
1
  import { Container, Sprite } from "pixi.js";
2
2
  import { Spine } from "pixi-spine";
3
3
  /**
4
- * Class representing container with all spines
4
+ * Class representing container with all spines. Every used spine have to be put in `allSpines` array to enable battery saver functionality
5
5
  *
6
6
  * @extends {Spine}
7
7
  * @class
@@ -2,7 +2,7 @@ import { Container, Sprite } from "pixi.js";
2
2
  import { Spine } from "pixi-spine";
3
3
  import { setTimeScale } from "../../utils";
4
4
  /**
5
- * Class representing container with all spines
5
+ * Class representing container with all spines. Every used spine have to be put in `allSpines` array to enable battery saver functionality
6
6
  *
7
7
  * @extends {Spine}
8
8
  * @class
@@ -93,9 +93,6 @@ export class AbstractColumnsContainer extends Container {
93
93
  const configureSpinAction = configuredBlindSpinsActions.shift();
94
94
  if (configureSpinAction !== undefined) {
95
95
  if (indexesOfReelsToExtendSpinningTime.includes(index)) {
96
- indexesOfReelsToExtendSpinningTime.forEach((number) => {
97
- this.allColumns[number].changeMultiplier();
98
- });
99
96
  this.currentColumn = this.allColumns[index];
100
97
  this.currentColumn.adaptToSpeed(RainMan.settingsStore.currentSpeed);
101
98
  frame.invokeMysteryFx(this.currentColumn.x, this.currentColumn.y);
@@ -7,7 +7,8 @@ import { AbstractInnerFrame } from "./AbstractInnerFrame";
7
7
  import { MysteryFxCoordinates } from "./types";
8
8
  import { WinLineAnimation } from "./WinLineAnimation";
9
9
  /**
10
- * This class is representing all of elements in center frame like Columns Container, frame animation
10
+ * Class aggregating all reels and activities related to them. Each frame has its own proportions, which allow for proper positioning on the screen.
11
+ * This represents all of elements in center frame like {@link ColumnsContainer}, frame animation (on {@link FrameLayer})
11
12
  *
12
13
  * @export
13
14
  * @abstract
@@ -35,13 +36,27 @@ export declare abstract class AbstractFrame extends ResumableContainer implement
35
36
  protected constructor(spineName: string);
36
37
  get columnsContainer(): AbstractColumnsContainer;
37
38
  adaptToSpeed(speedLevel: SpeedLevel): void;
39
+ /**
40
+ * Invoke mystery fx on symbol position
41
+ *
42
+ * @param x {number}
43
+ * @param y {number}
44
+ */
38
45
  invokeMysteryFx(x: number, y: number): void;
39
46
  protected repositionMysteryFx(_x: number, _y: number): void;
40
47
  hideMysteryFx(): void;
41
48
  private resetMysteryFxCoordinates;
42
49
  destroyMysteryFx(): void;
50
+ /**
51
+ * Create win line animation, individual for each game, based on {@link WinLineAnimation}
52
+ * */
43
53
  protected createWinLineAnimation(_animationName: string): WinLineAnimation | null;
44
54
  playAllWinLineAnimations(animationNames: string[]): Promise<void>;
55
+ /**
56
+ * Creates and plays win line animation.
57
+ *
58
+ * @param animationName
59
+ */
45
60
  playWinLineAnimation(animationName: string): Promise<void>;
46
61
  stopPlayingWinLineAnimations(): void;
47
62
  isPlayingWinLineAnimation(): boolean;
@@ -5,7 +5,8 @@ import { RainMan } from "../../Rainman";
5
5
  import { getDeviceOrientation, getSpineData, logError, scaleToParent } from "../../utils";
6
6
  import { ResumableContainer } from "../common";
7
7
  /**
8
- * This class is representing all of elements in center frame like Columns Container, frame animation
8
+ * Class aggregating all reels and activities related to them. Each frame has its own proportions, which allow for proper positioning on the screen.
9
+ * This represents all of elements in center frame like {@link ColumnsContainer}, frame animation (on {@link FrameLayer})
9
10
  *
10
11
  * @export
11
12
  * @abstract
@@ -35,6 +36,12 @@ export class AbstractFrame extends ResumableContainer {
35
36
  adaptToSpeed(speedLevel) {
36
37
  this.velocityMultiplier = this.speedLevelMapper[speedLevel];
37
38
  }
39
+ /**
40
+ * Invoke mystery fx on symbol position
41
+ *
42
+ * @param x {number}
43
+ * @param y {number}
44
+ */
38
45
  invokeMysteryFx(x, y) {
39
46
  if (!this.mysteryFxConfig)
40
47
  return;
@@ -78,12 +85,20 @@ export class AbstractFrame extends ResumableContainer {
78
85
  this.mysteryFxHighlight = null;
79
86
  }
80
87
  }
88
+ /**
89
+ * Create win line animation, individual for each game, based on {@link WinLineAnimation}
90
+ * */
81
91
  createWinLineAnimation(_animationName) {
82
92
  return null;
83
93
  }
84
94
  async playAllWinLineAnimations(animationNames) {
85
95
  await Promise.allSettled(animationNames.map((animationName) => this.playWinLineAnimation(animationName)));
86
96
  }
97
+ /**
98
+ * Creates and plays win line animation.
99
+ *
100
+ * @param animationName
101
+ */
87
102
  async playWinLineAnimation(animationName) {
88
103
  const winLineAnimation = this.createWinLineAnimation(animationName);
89
104
  if (winLineAnimation === null) {
@@ -1,7 +1,7 @@
1
1
  import { Container } from "pixi.js";
2
2
  import { AbstractColumnsContainer } from "./AbstractColumnsContainer";
3
3
  /**
4
- * Wrapper class for Columns Container
4
+ * Wrapper class for Columns Container {@link ColumnsContainer}
5
5
  *
6
6
  * @export
7
7
  * @abstract
@@ -1,7 +1,7 @@
1
1
  import { Container } from "pixi.js";
2
2
  import { FrameLayer } from "../../layers";
3
3
  /**
4
- * Wrapper class for Columns Container
4
+ * Wrapper class for Columns Container {@link ColumnsContainer}
5
5
  *
6
6
  * @export
7
7
  * @abstract
@@ -12,7 +12,7 @@ import { LoadersSpineData, Nullable } from "../../utils";
12
12
  */
13
13
  export declare abstract class AbstractSymbolBase extends Container {
14
14
  private multiplierSpineName;
15
- protected symbolImage: Sprite;
15
+ symbolImage: Sprite;
16
16
  spine: Spine;
17
17
  protected destroySuffix: string;
18
18
  protected animationSpeedMultiplier: number;
@@ -62,7 +62,7 @@ export class AbstractSymbolBase extends Container {
62
62
  return new Promise((resolve) => {
63
63
  this.spine = new Spine(getSpineData(specialResourceName));
64
64
  this.endOfSwapAnimationPromise = resolve;
65
- this.spine.state.timeScale = (this.animationSpeedMultiplier = 1) ? 1.5 : this.animationSpeedMultiplier;
65
+ this.spine.state.timeScale = this.animationSpeedMultiplier === 1 ? 1.5 : this.animationSpeedMultiplier;
66
66
  this.spine.state.setAnimation(0, animationName, false);
67
67
  this.spine.scale.set(spineScale);
68
68
  this.addChild(this.spine);
@@ -6,7 +6,7 @@ import { AbstractColumnsContainer, AbstractFrame } from "../frame";
6
6
  import { AbstractSymbolBase } from "./AbstractSymbolBase";
7
7
  import { AnimationTimeSettings } from "./types";
8
8
  /**
9
- * Class represent single column in ColumnsContainer
9
+ * Class represent single column in {@link ColumnsContainer}. It contains array of {@link AbstractSymbolBase}
10
10
  *
11
11
  * @export
12
12
  * @abstract
@@ -52,7 +52,6 @@ export declare abstract class AbstractSymbolsColumn extends Container implements
52
52
  get id(): string;
53
53
  protected get componentsTimingSettings(): AnimationTimeSettings;
54
54
  adaptToSpeed(speedLevel: SpeedLevel): void;
55
- changeMultiplier(): void;
56
55
  speedUpForMysterySpin(velocity: number, duration: number): Promise<void>;
57
56
  changeVelocity(velocity: number, duration: number, frame?: AbstractFrame): Promise<void>;
58
57
  protected animateDependentComponents(_distance: number): void;
@@ -8,7 +8,7 @@ import { logInfo } from "../../utils";
8
8
  import { droppableSymbolsFactory } from "./DroppableSymbolsColumn";
9
9
  import { Phase, Speed } from "./types";
10
10
  /**
11
- * Class represent single column in ColumnsContainer
11
+ * Class represent single column in {@link ColumnsContainer}. It contains array of {@link AbstractSymbolBase}
12
12
  *
13
13
  * @export
14
14
  * @abstract
@@ -80,15 +80,11 @@ export class AbstractSymbolsColumn extends Container {
80
80
  this.velocityMultiplier = this.speedLevelMapper[speedLevel];
81
81
  this.symbols.forEach((symbol) => symbol.updateTimeScaleOfSpine(this.velocityMultiplier));
82
82
  }
83
- changeMultiplier() {
84
- this.velocityMultiplier = 3.5;
85
- }
86
83
  async speedUpForMysterySpin(velocity, duration) {
87
84
  await new Promise((resolve) => {
88
85
  this.resolveMysterySpeedUp = resolve;
89
- this.tween = new TWEEN.Tween({ velocity: velocity })
90
- .to({ value: 70 }, duration)
91
- .easing(TWEEN.Easing.Linear.None)
86
+ this.tween = new TWEEN.Tween({ velocity: Speed.FAST })
87
+ .to({ velocity: velocity }, duration)
92
88
  .onUpdate((value) => {
93
89
  this.velocity = value.velocity;
94
90
  })
@@ -1,7 +1,7 @@
1
1
  import { SymbolId } from "../../application";
2
2
  import { AbstractSymbolBase } from "./AbstractSymbolBase";
3
3
  /**
4
- * This class represents symbol that can be dropped from column
4
+ * This class represents symbol that can be dropped from column. Based on transformation type `drop` from {@link transformationTypes}
5
5
  *
6
6
  * @export
7
7
  * @class DroppableSymbol
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This class represents symbol that can be dropped from column
2
+ * This class represents symbol that can be dropped from column. Based on transformation type `drop` from {@link transformationTypes}
3
3
  *
4
4
  * @export
5
5
  * @class DroppableSymbol
@@ -64,6 +64,7 @@ export class ConnectionWrapper {
64
64
  this.subscribers.forEach((subscriberFn) => {
65
65
  subscriberFn();
66
66
  });
67
+ RainMan.globals.actionsAfterClosureWebSocket?.();
67
68
  });
68
69
  this.webSocketConnection.addEventListener("message", (event) => this.handleMessage(JSON.parse(event.data)));
69
70
  logInfo("connection established, listener set");
@@ -60,6 +60,9 @@ export interface RangeSymbolMultiplierTable {
60
60
  type: typeof PaytableTypes.range;
61
61
  quantity: RangeQuantityValue;
62
62
  }
63
+ /**
64
+ * Type for symbol (or jackpots if present) paytables
65
+ */
63
66
  export type SymbolMultiplierTable = FixedSymbolMultiplierTable | RangeSymbolMultiplierTable;
64
67
  export type PayTableInterface = Record<string, SymbolMultiplierTable>;
65
68
  export interface SpinDataInterface {
@@ -1,6 +1,9 @@
1
1
  import { transformationTypes } from "constants/transformation";
2
2
  import { SymbolId } from "../application";
3
3
  import { SymbolReels } from "./wins";
4
+ /**
5
+ * Describes coordinated of symbol on reels
6
+ */
4
7
  export type Point = {
5
8
  x: number;
6
9
  y: number;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This object represents all the states in Rainman game
2
+ * This object represents all game states in Rainman game
3
3
  */
4
4
  export declare const gamePhases: {
5
5
  readonly IDLE: "idle";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This object represents all the states in Rainman game
2
+ * This object represents all game states in Rainman game
3
3
  */
4
4
  export const gamePhases = {
5
5
  IDLE: "idle",
@@ -1,3 +1,6 @@
1
+ /**
2
+ * All transformation types available in Rainman games
3
+ */
1
4
  export declare const transformationTypes: {
2
5
  readonly destroy: "destroy";
3
6
  readonly drop: "drop";
@@ -1,3 +1,6 @@
1
+ /**
2
+ * All transformation types available in Rainman games
3
+ */
1
4
  export const transformationTypes = {
2
5
  destroy: "destroy",
3
6
  drop: "drop",
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Describes all possible win types in all of Rainman games
3
+ */
1
4
  export declare const PossibleWins: {
2
5
  readonly mystery: "mystery";
3
6
  readonly streak: "streak";
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Describes all possible win types in all of Rainman games
3
+ */
1
4
  export const PossibleWins = {
2
5
  mystery: "mystery",
3
6
  streak: "streak",
@@ -10,7 +10,7 @@ import { SpinDataWithLogic } from "./types";
10
10
  import { UiController } from "./UiController";
11
11
  /**
12
12
  * Abstract controller class for games, this class control game flow
13
- * and handle all game logic
13
+ * and handle all game logic, including wins, transformations
14
14
  *
15
15
  * @abstract
16
16
  * @class AbstractController
@@ -56,17 +56,29 @@ export declare abstract class AbstractController<T> {
56
56
  * Function for initializing function after timeout
57
57
  */
58
58
  reinitializeUserBalanceData(): void;
59
+ /**
60
+ * Function for reinitializing all buttons
61
+ */
59
62
  reinitializeAllButtons(): void;
60
63
  private setupSpaceOrEnterListener;
61
64
  disableBetButtons(shouldBeDisabled: boolean): void;
62
65
  private disableSpeedButton;
63
66
  private disableInformationButtons;
64
- private disableFreeSpinButton;
65
67
  protected handleDisablingButtons(disabled?: boolean): void;
66
68
  private initButtons;
67
69
  private initBetButtons;
68
70
  private initSpinButton;
71
+ /**
72
+ * This function is responsible for checking if buttons (not bet buttons) should be disabled
73
+ *
74
+ * @return {boolean}
75
+ */
69
76
  get shouldButtonsBeDisabled(): boolean;
77
+ /**
78
+ * This function is responsible for checking if bet buttons should be disabled
79
+ *
80
+ * @return {boolean}
81
+ */
70
82
  get shouldBetButtonsBeDisabled(): boolean;
71
83
  get lastWinAmount(): number;
72
84
  get balance(): number;
@@ -91,12 +103,15 @@ export declare abstract class AbstractController<T> {
91
103
  protected changeGamePhase(newPhase: GamePhase): void;
92
104
  private setRefreshButtonBasedOnPhase;
93
105
  private setMessageBoxBasedOnPhase;
106
+ /**
107
+ * This function is responsible for getting indexes of reels which should show mystery fx, based on {@link spinLogic}
108
+ * @param {SpinLogic} spinLogic
109
+ */
94
110
  protected getReelIndexesToShowMysteryFx(spinLogic: SpinLogic): number[];
95
111
  /**
96
112
  * Function is responsible for initializing the spin process
97
113
  * This also is handler for refresh button and space functionalities
98
114
  * After the spin, this function removes free spin plate/summary, big win, mystery containers
99
- *
100
115
  */
101
116
  protected handleSpinLogic(): void;
102
117
  /**
@@ -108,6 +123,9 @@ export declare abstract class AbstractController<T> {
108
123
  * Function for autoplay spin
109
124
  */
110
125
  protected autoplaySpin(): void;
126
+ /**
127
+ * Function for clearing and destroying actions in win actions queue
128
+ */
111
129
  protected clearAndDestroyActions(): void;
112
130
  /**
113
131
  * Function disabling autoplay functionality
@@ -122,6 +140,11 @@ export declare abstract class AbstractController<T> {
122
140
  * @param {SpinLogic} _spinLogic
123
141
  */
124
142
  protected onDataFetch(_spinData: SpinData, _spinLogic: SpinLogic): void;
143
+ /**
144
+ * Getter for extra data for some games
145
+ *
146
+ * @returns {ExtraDataRequest}
147
+ */
125
148
  protected getExtraData(): ExtraDataRequest;
126
149
  /**
127
150
  * Function for fetching and preparing spin data
@@ -129,6 +152,10 @@ export declare abstract class AbstractController<T> {
129
152
  * @returns {SpinDataWithLogic}
130
153
  */
131
154
  protected fetchAndPrepareSpinData(): Promise<SpinDataWithLogic>;
155
+ /**
156
+ * Checks if we can skip action based on conditions. By default it checks {@link !this.isPlayingUnskippableStreak}
157
+ *
158
+ */
132
159
  protected canSkipActions(): boolean;
133
160
  protected onSpinningStart(): Promise<void>;
134
161
  protected onSpinningEnd(_spinLogic: SpinLogic): Promise<void>;
@@ -148,16 +175,53 @@ export declare abstract class AbstractController<T> {
148
175
  * @returns {Promise<void>}
149
176
  */
150
177
  private spin;
178
+ /**
179
+ * Function for invoking free spin plate, invoked in mainContainer
180
+ * ```ts
181
+ * this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins, isAdditionalFreeSpin);
182
+ * ```
183
+ *
184
+ * @param numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
185
+ * @param isAdditionalFreeSpin - flag for displaying additional free spins
186
+ */
151
187
  private handleFreeSpinPlateInvocation;
188
+ /**
189
+ * Function for invoking free spin summary plate, invoked in mainContainer
190
+ * ```ts
191
+ * this.mainContainer.invokeFreeSpinSummary(numberOfFreeSpins, totalFreeSpinWinAmount);
192
+ * ```
193
+ */
152
194
  protected handleFreeSpinSummaryPlateInvocation(): Promise<void>;
153
195
  private handleAutoplayLogic;
154
196
  private lockLogicWhileSpinning;
155
197
  private unlockLogicAfterSpinning;
156
198
  protected stopPlayingSymbolsStreak(): void;
157
199
  protected stopPlayingSymbolsTransformation(): void;
200
+ /**
201
+ * Function for displaying big win. Invoking that by `this.mainContainer.invokeBigWin();` and destroying it by `this.mainContainer.destroyBigWin();`
202
+ *
203
+ * @param customAmount - amount of win, if not provided, `RainMan.settingsStore.bet` will be used
204
+ */
158
205
  protected countBigWin(customAmount?: number): Promise<void>;
206
+ /**
207
+ * Function for displaying bonus win. Invoking that by `this.mainContainer.invokeBonusWin();` and destroying it by `this.mainContainer.destroyBonusWin();`
208
+ *
209
+ * @param customAmount - amount of win, if not provided, `RainMan.settingsStore.bet` will be used
210
+ */
159
211
  protected countBonusWin(winAmount?: number): Promise<void>;
212
+ /**
213
+ * Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
214
+ *
215
+ * @param winAmount - amount of win, if not provided `RainMan.settingsStore.cumulativeWinAmount` will be used
216
+ */
160
217
  protected countSuperBonusWin(winAmount?: number): Promise<void>;
218
+ /**
219
+ * Function for displaying mystery win. Invoking that by `this.mainContainer.invokeMysteryWin();` and destroying it by `this.mainContainer.destroyMysteryWin();`.
220
+ * Function requires `this.mysteryWinSymbol` to be fired.
221
+ *
222
+ * @param winAmount
223
+ * @param quantity - how many symbols create mystery win, by default 3
224
+ */
161
225
  protected countMysteryWin(winAmount?: number, quantity?: number): Promise<void>;
162
226
  /**
163
227
  * Parser for streaks and reels quantity
@@ -167,11 +231,30 @@ export declare abstract class AbstractController<T> {
167
231
  * @returns {StreakReelsIndexes}
168
232
  */
169
233
  protected parseStreak(streak: StreakReelsIndexes, reelsQuantity: number): StreakReelsIndexes;
234
+ /**
235
+ * Function for getting symbols ids from {@link StreakReelsIndexes}
236
+ *
237
+ * @param streak
238
+ */
170
239
  protected getSymbolIdsForStreak(streak: StreakReelsIndexes): SymbolId[];
171
240
  protected updateUiValues(value: number): void;
241
+ /**
242
+ * Function for composing win actions queue based on wins and transformations from {@link transformationTypes} and {@link PossibleWins}
243
+ *
244
+ * @param spinLogic
245
+ */
172
246
  protected abstract composeWinActionsQueue(spinLogic: SpinLogic): void;
247
+ /**
248
+ * Function for playing win actions queue from `this.winActionsQueue` or `this.winActionsQueueSorted`, if used.
249
+ */
173
250
  protected abstract playWinActionQueue(): Promise<void>;
251
+ /**
252
+ * Function will turn off loop while `RainMan.settingsStore.isAutoplayEnabled` is `true`
253
+ */
174
254
  protected handleLoopingWinActionQueue(): Promise<void>;
255
+ /**
256
+ * Function for looping win actions queue, after initial play
257
+ */
175
258
  protected loopWinActionsQueue(): Promise<void>;
176
259
  getFreeSpinsWins(spinLogic: SpinLogic): FreeSpinWin[];
177
260
  }