pixi-rainman-game-engine 0.2.15 → 0.2.16

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.
@@ -49,7 +49,7 @@ export const AutoplaySettings = observer(() => {
49
49
  useEffect(() => {
50
50
  updateLimitsBounds(initialAutoSpinCount);
51
51
  }, []);
52
- const { singleWinExceeds, balancedIncreased, balancedDecreased, howManyAutoSpinsLeft, infinitySpinsEnabled, setSingleWinExceeds, setBalancedIncreased, setBalancedDecreased, setAutoSpinsCount, flipInfinitySpinsFlag, resetAutoplaySettings, isAutoplayEnabled, } = settingStore;
52
+ const { singleWinExceeds, balancedIncreased, balancedDecreased, howManyAutoSpinsLeft, infinitySpinsEnabled, setSingleWinExceeds, setBalancedIncreased, setBalancedDecreased, setAutoSpinsCount, flipInfinitySpinsFlag, resetAutoplaySettings, } = settingStore;
53
53
  return (<div className="autoplay-settings">
54
54
  <CloseModalButton layerId={UI_ITEMS.autoplay}/>
55
55
  <div className="autoplay-settings__title">
@@ -110,11 +110,7 @@ export const AutoplaySettings = observer(() => {
110
110
  }}>
111
111
  <p>{i18next.t("cancel")}</p>
112
112
  </button>
113
- <button id={COMPONENTS.autoSpinConfirm} onClick={() => {
114
- if (isAutoplayEnabled)
115
- return;
116
- settingStore.decreaseAutoSpinsCount();
117
- }} className="autoplay-settings__confirmation-button">
113
+ <button id={COMPONENTS.autoSpinConfirm} className="autoplay-settings__confirmation-button">
118
114
  <p>{i18next.t("confirm")}</p>
119
115
  </button>
120
116
  </div>
@@ -16,13 +16,13 @@ export const BetControls = observer(() => {
16
16
  return (<div className="bet-container">
17
17
  <h2>{i18next.t("totalBet")}</h2>
18
18
  <div className="bet-container__controls">
19
- <button disabled={settingStore.betChangeDisabled} onClick={() => onClick("decrease")} className="bet-container__button" name="bet-minus">
19
+ <button disabled={settingStore.isFreeSpinsPlayEnabled || settingStore.betChangeDisabled} onClick={() => onClick("decrease")} className="bet-container__button" name="bet-minus">
20
20
  -
21
21
  </button>
22
22
  <div className="bet-container__value">
23
23
  <p>{settingStore.betText}</p>
24
24
  </div>
25
- <button disabled={settingStore.betChangeDisabled} onClick={() => onClick("increase")} className="bet-container__button" name="bet-plus">
25
+ <button disabled={settingStore.isFreeSpinsPlayEnabled || settingStore.betChangeDisabled} onClick={() => onClick("increase")} className="bet-container__button" name="bet-plus">
26
26
  +
27
27
  </button>
28
28
  </div>
@@ -3,7 +3,7 @@ import { sample } from "lodash";
3
3
  import { SoundManager } from "../../application";
4
4
  import { AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, MessageBox, SpeedControlButton, VolumeButton, } from "../../components";
5
5
  import { RainMan } from "../../Rainman";
6
- import { allUiItems, hideLayerIfPresent, UI_ITEMS } from "../../utils";
6
+ import { allUiItems, hideLayerIfPresent, UI_ITEMS, wait } from "../../utils";
7
7
  import { SPEED_LEVELS } from "../SpeedState";
8
8
  /** @ignore */
9
9
  export const SPEED_PREFIX = "speed-";
@@ -130,7 +130,9 @@ export class ButtonsEventManager {
130
130
  const animatedBackground = RainMan.componentRegistry.get(Background.registryName);
131
131
  animatedBackground.eventMode = "static";
132
132
  animatedBackground.addListener("pointerdown", () => {
133
- if (hideLayerIfPresent() && !RainMan.settingsStore.isAutoplayEnabled) {
133
+ if (hideLayerIfPresent() &&
134
+ !RainMan.settingsStore.isAutoplayEnabled &&
135
+ !RainMan.settingsStore.isFreeSpinsPlayEnabled) {
134
136
  this.enableButtons();
135
137
  }
136
138
  });
@@ -270,6 +272,7 @@ export class ButtonsEventManager {
270
272
  confirmAutoplayButton.addEventListener("click", () => {
271
273
  RainMan.settingsStore.handleModalInvocation?.(UI_ITEMS.autoplay);
272
274
  confirmAutoplayButtonCallback();
275
+ wait(1).then(() => RainMan.settingsStore.decreaseAutoSpinsCount());
273
276
  });
274
277
  }
275
278
  }
@@ -42,6 +42,7 @@ export class SoundManagerInstance {
42
42
  preload: true,
43
43
  loaded: () => resolve(),
44
44
  });
45
+ sound.name = soundName;
45
46
  this.musicCatalogue.set(soundName, sound);
46
47
  }));
47
48
  }
@@ -52,7 +53,14 @@ export class SoundManagerInstance {
52
53
  * @param {number} volumeLevel - volume level from 0-1
53
54
  */
54
55
  setVolume(volumeLevel) {
55
- this.musicCatalogue.forEach((sound) => (sound.volume = volumeLevel));
56
+ this.musicCatalogue.forEach((sound) => {
57
+ if (sound?.name === "music") {
58
+ sound.volume = volumeLevel * 0.5;
59
+ }
60
+ else {
61
+ sound.volume = volumeLevel;
62
+ }
63
+ });
56
64
  }
57
65
  /**
58
66
  * Function for stopping sound effect in game
@@ -87,7 +95,11 @@ export class SoundManagerInstance {
87
95
  return;
88
96
  if (soundName === "music" && sound.isPlaying && !RainMan.settingsStore.ambientMusicFlag)
89
97
  return;
90
- sound.play({ loop: soundsToLoop.includes(soundName), singleInstance: true });
98
+ sound.play({
99
+ loop: soundsToLoop.includes(soundName),
100
+ singleInstance: true,
101
+ volume: soundName === "music" ? 0.5 : 1,
102
+ });
91
103
  }
92
104
  /**
93
105
  * Function for resuming all sounds in game
@@ -1,3 +1,4 @@
1
+ import { Sound } from "@pixi/sound";
1
2
  /**
2
3
  * Object for mapping SoundTracks to appropriate asset.
3
4
  * All properties must be set, if no sound should be played set empty string
@@ -88,3 +89,10 @@ export type GameSoundAssets = Record<SoundTrack, string>;
88
89
  * @typedef {SoundOverrides}
89
90
  */
90
91
  export type SoundOverrides = Partial<Record<SoundTrack, SoundTrack>>;
92
+ /**
93
+ * Type for overriding sound tracks in game, extended with sound name
94
+ * @typedef {NamedSound}
95
+ */
96
+ export type NamedSound = Sound & {
97
+ name: string;
98
+ };
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * Note: This should be done once at the lifecycle of the game
5
5
  * Function creates also the react layer
6
- * @returns {ReactNode}
6
+ * @returns {ReactNode} the root element with canvas and react layer
7
7
  */
8
8
  export declare const setup: () => HTMLDivElement;
@@ -7,7 +7,7 @@ import { changeResolution, disableMagnifyingGlassOnIOS, getDeviceOrientation, in
7
7
  *
8
8
  * Note: This should be done once at the lifecycle of the game
9
9
  * Function creates also the react layer
10
- * @returns {ReactNode}
10
+ * @returns {ReactNode} the root element with canvas and react layer
11
11
  */
12
12
  export const setup = () => {
13
13
  changeResolution(RainMan.settingsStore.HiResolutionFlag);
@@ -405,6 +405,10 @@ export class AbstractMainContainer extends Container {
405
405
  this.initComponentsForScreenRatio();
406
406
  this.resizeDependentComponents();
407
407
  this.repositionComponentsForScreenRatio();
408
+ if (RainMan.settingsStore.isFreeSpinsPlayEnabled) {
409
+ RainMan.componentRegistry.get(BUTTONS.plus).flipDisabledFlag(true);
410
+ RainMan.componentRegistry.get(BUTTONS.neg).flipDisabledFlag(true);
411
+ }
408
412
  }
409
413
  createLeftButtons() {
410
414
  return new LeftButtons();
@@ -39,9 +39,9 @@ export declare abstract class AbstractColumnsContainer extends Container impleme
39
39
  /**
40
40
  * This function is responsible for setting symbols in columns
41
41
  * @public
42
- * @param {SymbolReels} finalSymbolReels
43
- * @param {(value: void | PromiseLike<void>) => void} afterSpinResolver
44
- * @param {number[]} indexesOfReelsToExtendSpinningTime
42
+ * @param {SymbolReels} finalSymbolReels final symbols in columns
43
+ * @param {(value: void | PromiseLike<void>) => void} afterSpinResolver resolver for after spin
44
+ * @param {number[]} indexesOfReelsToExtendSpinningTime indexes of reels to extend spinning time
45
45
  * @returns {Promise<void>}
46
46
  */
47
47
  configBlindSpin(finalSymbolReels: SymbolReels, afterSpinResolver: (value: void | PromiseLike<void>) => void, indexesOfReelsToExtendSpinningTime: number[]): Promise<void>;
@@ -52,10 +52,10 @@ export declare abstract class AbstractColumnsContainer extends Container impleme
52
52
  /**
53
53
  * Function for playing animation of streak
54
54
  * @public
55
- * @param {StreakReelsIndexes} streak
56
- * @param {number} reelsQuantity
57
- * @param {number} [multiplier]
58
- * @param {string} [suffix]
55
+ * @param {StreakReelsIndexes} streak streak to play
56
+ * @param {number} reelsQuantity number of reels
57
+ * @param {number} multiplier multiplier for animation
58
+ * @param {string} suffix suffix for animation
59
59
  * @returns {Promise<void>}
60
60
  */
61
61
  playStreak(streak: StreakReelsIndexes, reelsQuantity: number, multiplier?: number, suffix?: string): Promise<void>;
@@ -68,9 +68,9 @@ export class AbstractColumnsContainer extends Container {
68
68
  /**
69
69
  * This function is responsible for setting symbols in columns
70
70
  * @public
71
- * @param {SymbolReels} finalSymbolReels
72
- * @param {(value: void | PromiseLike<void>) => void} afterSpinResolver
73
- * @param {number[]} indexesOfReelsToExtendSpinningTime
71
+ * @param {SymbolReels} finalSymbolReels final symbols in columns
72
+ * @param {(value: void | PromiseLike<void>) => void} afterSpinResolver resolver for after spin
73
+ * @param {number[]} indexesOfReelsToExtendSpinningTime indexes of reels to extend spinning time
74
74
  * @returns {Promise<void>}
75
75
  */
76
76
  async configBlindSpin(finalSymbolReels, afterSpinResolver, indexesOfReelsToExtendSpinningTime) {
@@ -168,10 +168,10 @@ export class AbstractColumnsContainer extends Container {
168
168
  /**
169
169
  * Function for playing animation of streak
170
170
  * @public
171
- * @param {StreakReelsIndexes} streak
172
- * @param {number} reelsQuantity
173
- * @param {number} [multiplier]
174
- * @param {string} [suffix]
171
+ * @param {StreakReelsIndexes} streak streak to play
172
+ * @param {number} reelsQuantity number of reels
173
+ * @param {number} multiplier multiplier for animation
174
+ * @param {string} suffix suffix for animation
175
175
  * @returns {Promise<void>}
176
176
  */
177
177
  async playStreak(streak, reelsQuantity, multiplier = 1, suffix = "") {
@@ -144,6 +144,7 @@ export class MessageBox extends Container {
144
144
  if (this.autoSpinShown || this.freeSpinShown)
145
145
  return;
146
146
  this.autoSpinShown = true;
147
+ this.autoSpinText.set(RainMan.settingsStore.howManyAutoSpinsLeft + 1);
147
148
  this.centerTextOnX(this.autoSpinText);
148
149
  this.addChild(this.autoSpinText);
149
150
  }
@@ -1,8 +1,6 @@
1
1
  import { ExtraDataRequest, GambleCardColor, GambleDataInterface, InitDataInterface, ServerMessage, SpinData, SubscribableConnectionWrapper } from "../connectivity";
2
2
  /**
3
3
  * Class for managing connection to the server via websockets
4
- *
5
- *
6
4
  */
7
5
  export declare class ConnectionWrapper implements SubscribableConnectionWrapper {
8
6
  private webSocketConnection;
@@ -31,18 +29,18 @@ export declare class ConnectionWrapper implements SubscribableConnectionWrapper
31
29
  private transformFreeSpinData;
32
30
  /**
33
31
  * Method for fetching spin data from the server
34
- * @param {number} roundNumber
35
- * @param {number} bet
36
- * @param {ExtraDataRequest} extra_data
37
- * @returns {SpinData}
32
+ * @param {number} roundNumber round number
33
+ * @param {number} bet bet amount
34
+ * @param {ExtraDataRequest} extra_data extra data for the spin
35
+ * @returns {SpinData} spin data
38
36
  */
39
37
  fetchSpinData(roundNumber: number, bet: number, extra_data?: ExtraDataRequest): Promise<SpinData>;
40
38
  fetchGambleData(roundNumber: number, bet: number, choice: GambleCardColor): Promise<GambleDataInterface>;
41
39
  private getFreshWsInstance;
42
40
  /**
43
41
  * Method for fetching data from the server
44
- * @param {ServerRequest} request
45
- * @returns {ServerMessage}
42
+ * @param {ServerRequest} request request for the server
43
+ * @returns {ServerMessage} server response
46
44
  */
47
45
  private fetch;
48
46
  getMessageHistory(): ServerMessage[];
@@ -7,8 +7,6 @@ import { logError, logInfo, logWarn } from "../utils";
7
7
  const overrideMap = new Map();
8
8
  /**
9
9
  * Class for managing connection to the server via websockets
10
- *
11
- *
12
10
  */
13
11
  export class ConnectionWrapper {
14
12
  webSocketConnection;
@@ -110,10 +108,10 @@ export class ConnectionWrapper {
110
108
  }
111
109
  /**
112
110
  * Method for fetching spin data from the server
113
- * @param {number} roundNumber
114
- * @param {number} bet
115
- * @param {ExtraDataRequest} extra_data
116
- * @returns {SpinData}
111
+ * @param {number} roundNumber round number
112
+ * @param {number} bet bet amount
113
+ * @param {ExtraDataRequest} extra_data extra data for the spin
114
+ * @returns {SpinData} spin data
117
115
  */
118
116
  async fetchSpinData(roundNumber, bet, extra_data = {}) {
119
117
  if (typeof this.config?.token === "undefined") {
@@ -149,8 +147,8 @@ export class ConnectionWrapper {
149
147
  }
150
148
  /**
151
149
  * Method for fetching data from the server
152
- * @param {ServerRequest} request
153
- * @returns {ServerMessage}
150
+ * @param {ServerRequest} request request for the server
151
+ * @returns {ServerMessage} server response
154
152
  */
155
153
  async fetch(request) {
156
154
  if (this.fetchInProgress) {
@@ -62,6 +62,7 @@ export declare abstract class AbstractController<T> {
62
62
  reinitializeAllButtons(): void;
63
63
  private setupSpaceOrEnterListener;
64
64
  disableBetButtons(shouldBeDisabled: boolean): void;
65
+ disableAutoplayButton(shouldBeDisabled: boolean): void;
65
66
  private disableSpeedButton;
66
67
  disableInformationButtons(shouldBeDisabled: boolean): void;
67
68
  protected handleDisablingButtons(disabled?: boolean): void;
@@ -153,8 +154,18 @@ export declare abstract class AbstractController<T> {
153
154
  * @returns {boolean} can we skip actions
154
155
  */
155
156
  protected canSkipActions(): boolean;
157
+ /**
158
+ * Function to get additional actions on spin start
159
+ */
156
160
  protected onSpinningStart(): Promise<void>;
161
+ /**
162
+ * Function to perform additional actions on spin end
163
+ * @param {SpinLogic} _spinLogic spin logic
164
+ */
157
165
  protected onSpinningEnd(_spinLogic: SpinLogic): Promise<void>;
166
+ /**
167
+ * Function to perform additional actions after spin
168
+ */
158
169
  protected performActionsAfterSpin(): Promise<void>;
159
170
  protected gambleGameEnabler(winAmount: number): void;
160
171
  /**
@@ -176,8 +187,8 @@ export declare abstract class AbstractController<T> {
176
187
  * ```ts
177
188
  * this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins, isAdditionalFreeSpin);
178
189
  * ```
179
- * @param numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
180
- * @param isAdditionalFreeSpin - flag for displaying additional free spins
190
+ * @param {number | undefined} numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
191
+ * @param {boolean} isAdditionalFreeSpin - flag for displaying additional free spins
181
192
  */
182
193
  private handleFreeSpinPlateInvocation;
183
194
  /**
@@ -203,7 +214,7 @@ export declare abstract class AbstractController<T> {
203
214
  */
204
215
  protected countBonusWin(winAmount?: number): Promise<void>;
205
216
  /**
206
- * Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
217
+ * Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
207
218
  * @param {number | undefined} winAmount - amount of win, if not provided `RainMan.settingsStore.cumulativeWinAmount` will be used
208
219
  */
209
220
  protected countSuperBonusWin(winAmount?: number): Promise<void>;
@@ -227,7 +238,16 @@ export declare abstract class AbstractController<T> {
227
238
  * @returns {SymbolId[]} - symbols from streak
228
239
  */
229
240
  protected getSymbolIdsForStreak(streak: StreakReelsIndexes): SymbolId[];
241
+ /**
242
+ * Function for updating win and balance values
243
+ * @param {number} value - value to set
244
+ * @returns {void}
245
+ */
230
246
  updateUiValues(value: number): void;
247
+ /**
248
+ * Function for updating gamble values
249
+ * @param {number} value value to set
250
+ */
231
251
  updateGambleValues(value: number): void;
232
252
  /**
233
253
  * Function for composing win actions queue based on wins and transformations from {@link transformationTypes} and {@link PossibleWins}
@@ -246,5 +266,10 @@ export declare abstract class AbstractController<T> {
246
266
  * Function for looping win actions queue, after initial play
247
267
  */
248
268
  protected loopWinActionsQueue(): Promise<void>;
269
+ /**
270
+ * Function for getting wins from {@link spinLogic}
271
+ * @param {SpinLogic} spinLogic spin logic
272
+ * @returns {FreeSpinWin[]} - array of free spins wins
273
+ */
249
274
  getFreeSpinsWins(spinLogic: SpinLogic): FreeSpinWin[];
250
275
  }
@@ -82,6 +82,8 @@ export class AbstractController {
82
82
  this.buttonsEventManager.initFreeSpinModal();
83
83
  this.buttonsEventManager.setUpUIElementsInteractivity();
84
84
  this.buttonsEventManager.setConfirmAutoplayButton(() => {
85
+ if (RainMan.settingsStore.isAutoplayEnabled)
86
+ return;
85
87
  RainMan.settingsStore.setAutoPlayEnabledFlag(true);
86
88
  RainMan.componentRegistry.get(AutoplayButton.registryName).activate(true);
87
89
  RainMan.componentRegistry.get(BUTTONS.plus).flipDisabledFlag(true);
@@ -132,11 +134,11 @@ export class AbstractController {
132
134
  RainMan.componentRegistry.get(BUTTONS.plus),
133
135
  RainMan.componentRegistry.get(BUTTONS.neg),
134
136
  ];
135
- if (getDeviceOrientation().includes("mobile") && !RainMan.settingsStore.isAutoplayEnabled) {
136
- buttonsToChange.push(RainMan.componentRegistry.get(AutoplayButton.registryName));
137
- }
138
137
  buttonsToChange.forEach((button) => button.flipDisabledFlag(shouldBeDisabled));
139
138
  }
139
+ disableAutoplayButton(shouldBeDisabled) {
140
+ RainMan.componentRegistry.get(AutoplayButton.registryName).flipDisabledFlag(shouldBeDisabled);
141
+ }
140
142
  disableSpeedButton(shouldBeDisabled) {
141
143
  RainMan.componentRegistry.get(SpeedControlButton.registryName).flipDisabledFlag(shouldBeDisabled);
142
144
  }
@@ -150,6 +152,7 @@ export class AbstractController {
150
152
  }
151
153
  handleDisablingButtons(disabled) {
152
154
  this.disableBetButtons(disabled ?? this.shouldBetButtonsBeDisabled);
155
+ this.disableAutoplayButton(disabled ?? this.shouldBetButtonsBeDisabled);
153
156
  this.disableSpeedButton(disabled ?? this.shouldButtonsBeDisabled);
154
157
  this.disableInformationButtons(disabled ?? this.shouldButtonsBeDisabled);
155
158
  }
@@ -488,9 +491,8 @@ export class AbstractController {
488
491
  RainMan.settingsStore.decreaseAutoSpinsCount();
489
492
  }
490
493
  if (RainMan.settingsStore.howManyAutoSpinsLeft === 0) {
491
- this.uiController.messageBox.showIncentiveText();
492
- RainMan.globals.shouldShowModals = false;
493
494
  this.disableAutoplay();
495
+ RainMan.globals.shouldShowModals = false;
494
496
  }
495
497
  this.changeGamePhase(gamePhases.IDLE);
496
498
  return this.throttledSpin();
@@ -506,8 +508,8 @@ export class AbstractController {
506
508
  * Function disabling autoplay functionality
507
509
  */
508
510
  disableAutoplay() {
509
- RainMan.componentRegistry.get(AutoplayButton.registryName).activate(false);
510
511
  RainMan.componentRegistry.get(MessageBox.registryName).hideAutoSpinText();
512
+ RainMan.componentRegistry.get(AutoplayButton.registryName).activate(false);
511
513
  RainMan.componentRegistry.get(BUTTONS.plus).flipDisabledFlag(false);
512
514
  RainMan.componentRegistry.get(BUTTONS.neg).flipDisabledFlag(false);
513
515
  RainMan.settingsStore.resetAutoplaySettings();
@@ -560,8 +562,18 @@ export class AbstractController {
560
562
  canSkipActions() {
561
563
  return !this.isPlayingUnskippableStreak;
562
564
  }
565
+ /**
566
+ * Function to get additional actions on spin start
567
+ */
563
568
  async onSpinningStart() { }
569
+ /**
570
+ * Function to perform additional actions on spin end
571
+ * @param {SpinLogic} _spinLogic spin logic
572
+ */
564
573
  async onSpinningEnd(_spinLogic) { }
574
+ /**
575
+ * Function to perform additional actions after spin
576
+ */
565
577
  async performActionsAfterSpin() { }
566
578
  gambleGameEnabler(winAmount) {
567
579
  if (RainMan.componentRegistry.has(BUTTONS.gamble) && !RainMan.settingsStore.gambleGameUsed) {
@@ -688,6 +700,7 @@ export class AbstractController {
688
700
  this.mainContainer.destroyBigWin();
689
701
  this.columnsContainer.resetPlayedSounds();
690
702
  if (this.invokeFreeSpinPlateAfterWin || RainMan.settingsStore.isFreeSpinsBought) {
703
+ this.uiController.messageBox.hideCurrentWinText();
691
704
  this.mainContainer.messageBox.hideFreeSpinText();
692
705
  hideLayerIfPresent();
693
706
  const freeSpinWins = this.getFreeSpinsWins(spinLogic);
@@ -710,6 +723,9 @@ export class AbstractController {
710
723
  }
711
724
  RainMan.settingsStore.setRoundNumber(this.roundNumber);
712
725
  this.handleDisablingButtons();
726
+ if (RainMan.settingsStore.isFreeSpinsPlayEnabled) {
727
+ this.disableAutoplayButton(false);
728
+ }
713
729
  RainMan.settingsStore.setModalsAvailability(true);
714
730
  await this.performActionsAfterSpin();
715
731
  RainMan.globals.shouldShowModals = true;
@@ -719,8 +735,8 @@ export class AbstractController {
719
735
  * ```ts
720
736
  * this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins, isAdditionalFreeSpin);
721
737
  * ```
722
- * @param numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
723
- * @param isAdditionalFreeSpin - flag for displaying additional free spins
738
+ * @param {number | undefined} numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
739
+ * @param {boolean} isAdditionalFreeSpin - flag for displaying additional free spins
724
740
  */
725
741
  async handleFreeSpinPlateInvocation(numberOfFreeSpins, isAdditionalFreeSpin = false) {
726
742
  await this.buttonsEventManager.disableButtonsForAction(async () => {
@@ -846,7 +862,7 @@ export class AbstractController {
846
862
  });
847
863
  }
848
864
  /**
849
- * Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
865
+ * Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
850
866
  * @param {number | undefined} winAmount - amount of win, if not provided `RainMan.settingsStore.cumulativeWinAmount` will be used
851
867
  */
852
868
  async countSuperBonusWin(winAmount) {
@@ -933,6 +949,11 @@ export class AbstractController {
933
949
  });
934
950
  return symbolsIds;
935
951
  }
952
+ /**
953
+ * Function for updating win and balance values
954
+ * @param {number} value - value to set
955
+ * @returns {void}
956
+ */
936
957
  updateUiValues(value) {
937
958
  if (this.isLoopingWinActionsQueue)
938
959
  return;
@@ -946,6 +967,10 @@ export class AbstractController {
946
967
  this.uiController.updateShownBalance();
947
968
  }
948
969
  }
970
+ /**
971
+ * Function for updating gamble values
972
+ * @param {number} value value to set
973
+ */
949
974
  updateGambleValues(value) {
950
975
  this.uiController.setDisplayedCurrentWinGamble(value);
951
976
  }
@@ -963,6 +988,11 @@ export class AbstractController {
963
988
  * Function for looping win actions queue, after initial play
964
989
  */
965
990
  async loopWinActionsQueue() { }
991
+ /**
992
+ * Function for getting wins from {@link spinLogic}
993
+ * @param {SpinLogic} spinLogic spin logic
994
+ * @returns {FreeSpinWin[]} - array of free spins wins
995
+ */
966
996
  getFreeSpinsWins(spinLogic) {
967
997
  const wins = spinLogic.winScenarios.find((winScenario) => winScenario.wins.find((win) => win.type === PossibleWins.freeSpins))?.wins || [];
968
998
  return wins;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "description": "This repository contains all of the mechanics that used in rainman games.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",