pixi-rainman-game-engine 0.1.6 → 0.1.8
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.
- package/dist/ComponentRegistry/ComponentRegistry.d.ts +95 -0
- package/dist/ComponentRegistry/ComponentRegistry.js +95 -0
- package/dist/Money/MoneyText.d.ts +7 -0
- package/dist/Money/MoneyText.js +9 -2
- package/dist/Rainman/Rainman.d.ts +2 -0
- package/dist/Rainman/Rainman.js +3 -0
- package/dist/Rainman/appConfig.d.ts +6 -0
- package/dist/Rainman/appConfig.js +7 -3
- package/dist/Rainman/types.d.ts +1 -3
- package/dist/application/ApiConfig/ApiConfig.d.ts +113 -4
- package/dist/application/ApiConfig/ApiConfig.js +119 -12
- package/dist/application/ApiConfig/SymbolId.d.ts +13 -0
- package/dist/application/ApiConfig/TransformationTypesId.d.ts +14 -1
- package/dist/application/ApiConfig/WinTypeId.d.ts +14 -1
- package/dist/application/ButtonsEventManager/ButtonsEventManager.d.ts +95 -0
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +99 -4
- package/dist/application/SoundManager/SoundManager.d.ts +37 -3
- package/dist/application/SoundManager/SoundManager.js +36 -0
- package/dist/application/SoundManager/types.d.ts +1 -0
- package/dist/application/SpinLogic/SpinLogic.d.ts +7 -0
- package/dist/application/SpinLogic/SpinLogic.js +7 -0
- package/dist/application/SpinLogic/types.d.ts +2 -2
- package/dist/application/SpinLogic/util.d.ts +4 -2
- package/dist/application/SpinLogic/util.js +18 -1
- package/dist/application/setup.d.ts +7 -0
- package/dist/application/setup.js +7 -0
- package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.d.ts +9 -0
- package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.js +9 -0
- package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +6 -4
- package/dist/components/AbstractMainContainer/AbstractMainContainer.js +8 -6
- package/dist/components/GambleGame/GambleGame.d.ts +10 -0
- package/dist/components/GambleGame/GambleGame.js +10 -0
- package/dist/components/buttons/BaseButton/ButtonState.js +1 -1
- package/dist/components/common/AnimatedBackground.d.ts +12 -3
- package/dist/components/common/AnimatedBackground.js +15 -12
- package/dist/components/common/Background.d.ts +8 -0
- package/dist/components/common/Background.js +8 -0
- package/dist/components/common/FreeSpinBox.d.ts +8 -0
- package/dist/components/common/FreeSpinBox.js +8 -0
- package/dist/components/common/IResizableContainer.d.ts +3 -0
- package/dist/components/common/IResizableContainer.js +1 -0
- package/dist/components/common/Logo.d.ts +8 -0
- package/dist/components/common/Logo.js +8 -0
- package/dist/components/common/LogoStatic.d.ts +8 -0
- package/dist/components/common/LogoStatic.js +8 -0
- package/dist/components/common/ResumableContainers.d.ts +5 -1
- package/dist/components/common/ResumableContainers.js +7 -1
- package/dist/components/frame/AbstractColumnsContainer.d.ts +38 -3
- package/dist/components/frame/AbstractColumnsContainer.js +45 -19
- package/dist/components/frame/AbstractFrame.d.ts +18 -2
- package/dist/components/frame/AbstractFrame.js +30 -1
- package/dist/components/frame/AbstractInnerFrame.d.ts +9 -0
- package/dist/components/frame/AbstractInnerFrame.js +9 -0
- package/dist/components/frame/WinLineAnimation.d.ts +14 -2
- package/dist/components/frame/WinLineAnimation.js +20 -2
- package/dist/components/messageBox/MessageBox.d.ts +8 -0
- package/dist/components/messageBox/MessageBox.js +8 -0
- package/dist/components/symbols/AbstractSymbolBase.d.ts +9 -0
- package/dist/components/symbols/AbstractSymbolBase.js +9 -0
- package/dist/components/symbols/AbstractSymbolsColumn.d.ts +17 -4
- package/dist/components/symbols/AbstractSymbolsColumn.js +13 -3
- package/dist/components/symbols/DroppableSymbol.d.ts +7 -0
- package/dist/components/symbols/DroppableSymbol.js +7 -0
- package/dist/components/symbols/DroppableSymbolsColumn.d.ts +7 -0
- package/dist/components/symbols/DroppableSymbolsColumn.js +7 -0
- package/dist/connectivity/ConnectionWrapper.js +2 -0
- package/dist/connectivity/LocalConnectionWrapper.js +3 -0
- package/dist/connectivity/serverData.d.ts +2 -2
- package/dist/connectivity/transformation.d.ts +36 -2
- package/dist/connectivity/wins.d.ts +1 -1
- package/dist/controllers/AbstractController.d.ts +3 -2
- package/dist/controllers/AbstractController.js +2 -0
- package/dist/errors/SpineDataNotFound.d.ts +3 -0
- package/dist/errors/SpineDataNotFound.js +5 -0
- package/dist/errors/TextureNotFound.d.ts +3 -0
- package/dist/errors/TextureNotFound.js +5 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/loading/AbstractLoadingContainer.d.ts +9 -0
- package/dist/loading/AbstractLoadingContainer.js +9 -0
- package/dist/localStorage/localStorage.d.ts +5 -0
- package/dist/localStorage/localStorage.js +5 -0
- package/dist/stores/SettingsStore.d.ts +9 -2
- package/dist/stores/SettingsStore.js +8 -3
- package/dist/utils/assets/assetGetter.d.ts +44 -0
- package/dist/utils/assets/assetGetter.js +47 -2
- package/dist/utils/common/functions.d.ts +1 -0
- package/dist/utils/common/functions.js +3 -0
- package/dist/winComponents/AnimableParticlesEmitter.d.ts +13 -0
- package/dist/winComponents/AnimableParticlesEmitter.js +13 -0
- package/dist/winComponents/PositioningFrame.d.ts +8 -0
- package/dist/winComponents/PositioningFrame.js +8 -0
- package/dist/winComponents/UpdatableSpineContainer.d.ts +9 -0
- package/dist/winComponents/UpdatableSpineContainer.js +9 -0
- package/package.json +1 -1
|
@@ -7,19 +7,114 @@ export declare class ComponentRegistry {
|
|
|
7
7
|
private incentiveJobsManager;
|
|
8
8
|
private speedLevelHandler;
|
|
9
9
|
constructor(app: Application);
|
|
10
|
+
/**
|
|
11
|
+
* Method for changing temporarily speed for turbo spin
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
* @param {SpeedLevel} newSpeedLevel
|
|
15
|
+
*/
|
|
10
16
|
setTemporarySpeedLevel(newSpeedLevel: SpeedLevel): void;
|
|
17
|
+
/**
|
|
18
|
+
* Method for reverting speed level for turbo spin
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
11
22
|
revertTemporarySpeedLevel(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Setter fo speed level
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
* @param {SpeedLevel} newSpeedLevel
|
|
28
|
+
*/
|
|
12
29
|
setSpeedLevel(newSpeedLevel: SpeedLevel): void;
|
|
30
|
+
/**
|
|
31
|
+
* Setting the next available speed level
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
13
35
|
nextSpeedLevel(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Getter for current speed level
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
* @returns {SpeedLevel}
|
|
41
|
+
*/
|
|
14
42
|
getSpeedLevel(): SpeedLevel;
|
|
43
|
+
/**
|
|
44
|
+
* Setter for user activity time
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
15
48
|
setUserActivityTime(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Function for adding components into ComponentRegistry
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
* @param {Container} component
|
|
54
|
+
*/
|
|
16
55
|
add(component: Container): void;
|
|
56
|
+
/**
|
|
57
|
+
* Function for updating component that are in ComponentRegistry
|
|
58
|
+
*
|
|
59
|
+
* @public
|
|
60
|
+
* @param {Container} oldComponent
|
|
61
|
+
* @param {Container} newComponent
|
|
62
|
+
*/
|
|
17
63
|
update(oldComponent: Container, newComponent: Container): void;
|
|
64
|
+
/**
|
|
65
|
+
* Function for removing components from Component Registry
|
|
66
|
+
*
|
|
67
|
+
* @public
|
|
68
|
+
* @param {Container} component
|
|
69
|
+
*/
|
|
18
70
|
remove(component: Container): void;
|
|
71
|
+
/**
|
|
72
|
+
* Function that adapt speed of all components
|
|
73
|
+
*
|
|
74
|
+
* @public
|
|
75
|
+
* @param {SpeedLevel} speedLevel
|
|
76
|
+
*/
|
|
19
77
|
updateAllSpeedAdaptable(speedLevel: SpeedLevel): void;
|
|
78
|
+
/**
|
|
79
|
+
* Getter for components that are in ComponentRegistry
|
|
80
|
+
* Throws error if component is not present
|
|
81
|
+
*
|
|
82
|
+
* @public
|
|
83
|
+
* @template {keyof RegistryMap} T
|
|
84
|
+
* @param {T} componentName
|
|
85
|
+
* @returns {RegistryMap[T]}
|
|
86
|
+
*/
|
|
20
87
|
get<T extends keyof RegistryMap>(componentName: T): RegistryMap[T];
|
|
88
|
+
/**
|
|
89
|
+
* Getter for existing components that are in ComponentRegistry
|
|
90
|
+
*
|
|
91
|
+
* @public
|
|
92
|
+
* @template {keyof RegistryMap} T
|
|
93
|
+
* @param {T} componentName
|
|
94
|
+
* @returns {RegistryMap[T]}
|
|
95
|
+
*/
|
|
21
96
|
getIfExists<T extends keyof RegistryMap>(componentName: T): RegistryMap[T];
|
|
97
|
+
/**
|
|
98
|
+
* Helper function to check if the component is present in ComponentRegistry
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
* @template {keyof RegistryMap} T
|
|
102
|
+
* @param {T} componentName
|
|
103
|
+
* @returns {boolean}
|
|
104
|
+
*/
|
|
22
105
|
has<T extends keyof RegistryMap>(componentName: T): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Function for adding components
|
|
108
|
+
*
|
|
109
|
+
* @public
|
|
110
|
+
* @param {Container[]} components
|
|
111
|
+
*/
|
|
23
112
|
addMany(components: Container[]): void;
|
|
113
|
+
/**
|
|
114
|
+
* Function for removing components
|
|
115
|
+
*
|
|
116
|
+
* @public
|
|
117
|
+
* @param {Container[]} components
|
|
118
|
+
*/
|
|
24
119
|
removeMany(components: Container[]): void;
|
|
25
120
|
}
|
|
@@ -14,32 +14,71 @@ export class ComponentRegistry {
|
|
|
14
14
|
openFullscreen();
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Method for changing temporarily speed for turbo spin
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
* @param {SpeedLevel} newSpeedLevel
|
|
22
|
+
*/
|
|
17
23
|
setTemporarySpeedLevel(newSpeedLevel) {
|
|
18
24
|
this.speedLevelHandler.setSpeed(newSpeedLevel);
|
|
19
25
|
this.updateAllSpeedAdaptable(this.speedLevelHandler.currentSpeed);
|
|
20
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Method for reverting speed level for turbo spin
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
21
32
|
revertTemporarySpeedLevel() {
|
|
22
33
|
this.speedLevelHandler.setSpeed(RainMan.settingsStore.currentSpeed);
|
|
23
34
|
this.updateAllSpeedAdaptable(this.speedLevelHandler.currentSpeed);
|
|
24
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Setter fo speed level
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
* @param {SpeedLevel} newSpeedLevel
|
|
41
|
+
*/
|
|
25
42
|
setSpeedLevel(newSpeedLevel) {
|
|
26
43
|
this.speedLevelHandler.setSpeed(newSpeedLevel);
|
|
27
44
|
RainMan.settingsStore.setSpeedLevel(this.speedLevelHandler.currentSpeed);
|
|
28
45
|
this.updateAllSpeedAdaptable(RainMan.settingsStore.currentSpeed);
|
|
29
46
|
this.get(SpeedControlButton.registryName).forceTextureUpdate();
|
|
30
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Setting the next available speed level
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
31
53
|
nextSpeedLevel() {
|
|
32
54
|
this.speedLevelHandler.nextSpeed();
|
|
33
55
|
RainMan.settingsStore.setSpeedLevel(this.speedLevelHandler.currentSpeed);
|
|
34
56
|
this.updateAllSpeedAdaptable(RainMan.settingsStore.currentSpeed);
|
|
35
57
|
this.get(SpeedControlButton.registryName).forceTextureUpdate();
|
|
36
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Getter for current speed level
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
* @returns {SpeedLevel}
|
|
64
|
+
*/
|
|
37
65
|
getSpeedLevel() {
|
|
38
66
|
return this.speedLevelHandler.currentSpeed;
|
|
39
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Setter for user activity time
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
40
73
|
setUserActivityTime() {
|
|
41
74
|
this.incentiveJobsManager.updateLastTimeClicked();
|
|
42
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Function for adding components into ComponentRegistry
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
* @param {Container} component
|
|
81
|
+
*/
|
|
43
82
|
add(component) {
|
|
44
83
|
if (isSpeedAdapterInterface(component)) {
|
|
45
84
|
this.speedAdaptableComponents.add(component);
|
|
@@ -56,6 +95,13 @@ export class ComponentRegistry {
|
|
|
56
95
|
}
|
|
57
96
|
throw Error(`Cannot re-add component with the same name: ${component.name}`);
|
|
58
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Function for updating component that are in ComponentRegistry
|
|
100
|
+
*
|
|
101
|
+
* @public
|
|
102
|
+
* @param {Container} oldComponent
|
|
103
|
+
* @param {Container} newComponent
|
|
104
|
+
*/
|
|
59
105
|
update(oldComponent, newComponent) {
|
|
60
106
|
if (oldComponent.name !== newComponent.name) {
|
|
61
107
|
throw new Error(`Cannot update component ${oldComponent.name} to ${newComponent.name}`);
|
|
@@ -69,15 +115,36 @@ export class ComponentRegistry {
|
|
|
69
115
|
if (oldComponent.name)
|
|
70
116
|
this.registry.set(oldComponent.name, newComponent);
|
|
71
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Function for removing components from Component Registry
|
|
120
|
+
*
|
|
121
|
+
* @public
|
|
122
|
+
* @param {Container} component
|
|
123
|
+
*/
|
|
72
124
|
remove(component) {
|
|
73
125
|
if (component.name)
|
|
74
126
|
this.registry.delete(component.name);
|
|
75
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Function that adapt speed of all components
|
|
130
|
+
*
|
|
131
|
+
* @public
|
|
132
|
+
* @param {SpeedLevel} speedLevel
|
|
133
|
+
*/
|
|
76
134
|
updateAllSpeedAdaptable(speedLevel) {
|
|
77
135
|
this.speedAdaptableComponents.forEach((speedAdaptableComponent) => {
|
|
78
136
|
speedAdaptableComponent.adaptToSpeed(speedLevel);
|
|
79
137
|
});
|
|
80
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Getter for components that are in ComponentRegistry
|
|
141
|
+
* Throws error if component is not present
|
|
142
|
+
*
|
|
143
|
+
* @public
|
|
144
|
+
* @template {keyof RegistryMap} T
|
|
145
|
+
* @param {T} componentName
|
|
146
|
+
* @returns {RegistryMap[T]}
|
|
147
|
+
*/
|
|
81
148
|
get(componentName) {
|
|
82
149
|
const componentToReturn = this.registry.get(componentName);
|
|
83
150
|
if (componentToReturn == undefined) {
|
|
@@ -85,18 +152,46 @@ export class ComponentRegistry {
|
|
|
85
152
|
}
|
|
86
153
|
return componentToReturn;
|
|
87
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Getter for existing components that are in ComponentRegistry
|
|
157
|
+
*
|
|
158
|
+
* @public
|
|
159
|
+
* @template {keyof RegistryMap} T
|
|
160
|
+
* @param {T} componentName
|
|
161
|
+
* @returns {RegistryMap[T]}
|
|
162
|
+
*/
|
|
88
163
|
getIfExists(componentName) {
|
|
89
164
|
const componentToReturn = this.registry.get(componentName);
|
|
90
165
|
return componentToReturn;
|
|
91
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Helper function to check if the component is present in ComponentRegistry
|
|
169
|
+
*
|
|
170
|
+
* @public
|
|
171
|
+
* @template {keyof RegistryMap} T
|
|
172
|
+
* @param {T} componentName
|
|
173
|
+
* @returns {boolean}
|
|
174
|
+
*/
|
|
92
175
|
has(componentName) {
|
|
93
176
|
return this.registry.has(componentName);
|
|
94
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Function for adding components
|
|
180
|
+
*
|
|
181
|
+
* @public
|
|
182
|
+
* @param {Container[]} components
|
|
183
|
+
*/
|
|
95
184
|
addMany(components) {
|
|
96
185
|
for (const component of components) {
|
|
97
186
|
this.add(component);
|
|
98
187
|
}
|
|
99
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Function for removing components
|
|
191
|
+
*
|
|
192
|
+
* @public
|
|
193
|
+
* @param {Container[]} components
|
|
194
|
+
*/
|
|
100
195
|
removeMany(components) {
|
|
101
196
|
for (const component of components) {
|
|
102
197
|
this.remove(component);
|
package/dist/Money/MoneyText.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { Money } from "ts-money";
|
|
2
2
|
import { RainMan } from "../Rainman";
|
|
3
|
+
/**
|
|
4
|
+
* This class represents money in pixi application
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @class MoneyText
|
|
8
|
+
* @typedef {MoneyText}
|
|
9
|
+
*/
|
|
3
10
|
export class MoneyText {
|
|
4
11
|
money;
|
|
5
12
|
constructor(amount) {
|
|
6
|
-
this.money = Money.fromDecimal(amount, RainMan.
|
|
13
|
+
this.money = Money.fromDecimal(amount, RainMan.currency, Math.round);
|
|
7
14
|
}
|
|
8
15
|
toString() {
|
|
9
|
-
return `${this.money} ${RainMan.
|
|
16
|
+
return `${this.money} ${RainMan.currency.symbol_native}`;
|
|
10
17
|
}
|
|
11
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../components/dictionary/i18n";
|
|
2
2
|
import { Application } from "pixi.js";
|
|
3
|
+
import { Currency } from "ts-money";
|
|
3
4
|
import { SpinLogicFactory, SymbolIds, WinTypeIds } from "../application";
|
|
4
5
|
import { ComponentRegistry } from "../ComponentRegistry";
|
|
5
6
|
import { SettingsStore } from "../stores";
|
|
@@ -12,5 +13,6 @@ export declare class RainMan {
|
|
|
12
13
|
static settingsStore: SettingsStore;
|
|
13
14
|
static componentRegistry: ComponentRegistry;
|
|
14
15
|
static spinLogicFactory: SpinLogicFactory;
|
|
16
|
+
static currency: Currency;
|
|
15
17
|
constructor(app: Application, config: AppConfig, symbolIds: SymbolIds, winTypeIds: WinTypeIds, spinLogicFactory: SpinLogicFactory);
|
|
16
18
|
}
|
package/dist/Rainman/Rainman.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../components/dictionary/i18n";
|
|
2
2
|
import { merge } from "lodash";
|
|
3
|
+
import { Currencies } from "ts-money";
|
|
3
4
|
import { ComponentRegistry } from "../ComponentRegistry";
|
|
4
5
|
import { settingStore } from "../SettingsUI/hooks";
|
|
5
6
|
import { defaultAppConfig } from "./appConfig";
|
|
@@ -11,6 +12,7 @@ export class RainMan {
|
|
|
11
12
|
static settingsStore;
|
|
12
13
|
static componentRegistry;
|
|
13
14
|
static spinLogicFactory;
|
|
15
|
+
static currency;
|
|
14
16
|
constructor(app, config, symbolIds, winTypeIds, spinLogicFactory) {
|
|
15
17
|
RainMan.app = app;
|
|
16
18
|
RainMan.config = merge(defaultAppConfig, config);
|
|
@@ -19,5 +21,6 @@ export class RainMan {
|
|
|
19
21
|
RainMan.settingsStore = settingStore;
|
|
20
22
|
RainMan.componentRegistry = new ComponentRegistry(app);
|
|
21
23
|
RainMan.spinLogicFactory = spinLogicFactory;
|
|
24
|
+
RainMan.currency = Currencies["USD"];
|
|
22
25
|
}
|
|
23
26
|
}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { OptionalAppConfig } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* This object represents default object for pixi application
|
|
4
|
+
* Here you can specify the default font, color of text etc.
|
|
5
|
+
*
|
|
6
|
+
* @type {OptionalAppConfig}
|
|
7
|
+
*/
|
|
2
8
|
export declare const defaultAppConfig: OptionalAppConfig;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Color } from "pixi.js";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* This object represents default object for pixi application
|
|
4
|
+
* Here you can specify the default font, color of text etc.
|
|
5
|
+
*
|
|
6
|
+
* @type {OptionalAppConfig}
|
|
7
|
+
*/
|
|
3
8
|
export const defaultAppConfig = {
|
|
4
9
|
gameWidth: 1920,
|
|
5
10
|
gameHeight: 1080,
|
|
@@ -9,8 +14,7 @@ export const defaultAppConfig = {
|
|
|
9
14
|
updatableSpineContainerFontSize: 50,
|
|
10
15
|
fontColor: new Color(0xfbd400).toHex(),
|
|
11
16
|
updatableTextValueColor: new Color(0xffffff).toHex(),
|
|
12
|
-
fontFace: "HelveticaNeueLTStd",
|
|
13
|
-
currency: Currencies["USD"],
|
|
17
|
+
fontFace: ["HelveticaNeueLTStd"],
|
|
14
18
|
durationOfActions: {
|
|
15
19
|
eachColumnsSpinDelay: [0, 200, 700, 1200, 1800],
|
|
16
20
|
spinBaseTime: 800,
|
package/dist/Rainman/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Currency } from "ts-money";
|
|
2
1
|
import { DeepPartial } from "../utils";
|
|
3
2
|
export type RequiredAppConfig = {
|
|
4
3
|
websocketUrl: string;
|
|
@@ -12,13 +11,12 @@ export type OptionalAppConfig = {
|
|
|
12
11
|
gameWidth: number;
|
|
13
12
|
gameHeight: number;
|
|
14
13
|
idleTimeout: number;
|
|
15
|
-
currency: Currency;
|
|
16
14
|
fontSize: number;
|
|
17
15
|
updatableSpineContainerFontSize: number;
|
|
18
16
|
mobileFontSize: number;
|
|
19
17
|
fontColor: string;
|
|
20
18
|
updatableTextValueColor: string;
|
|
21
|
-
fontFace: string;
|
|
19
|
+
fontFace: string[];
|
|
22
20
|
durationOfActions: {
|
|
23
21
|
eachColumnsSpinDelay: number[];
|
|
24
22
|
spinBaseTime: number;
|
|
@@ -1,25 +1,134 @@
|
|
|
1
1
|
import { InitDataInterface } from "../../connectivity";
|
|
2
2
|
import { SymbolId } from "./SymbolId";
|
|
3
|
+
import { TransformationTypeId } from "./TransformationTypesId";
|
|
4
|
+
import { WinTypeId } from "./WinTypeId";
|
|
5
|
+
/**
|
|
6
|
+
* Class representing config for connection to API
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class ApiConfig
|
|
10
|
+
* @typedef {ApiConfig}
|
|
11
|
+
*/
|
|
3
12
|
export declare class ApiConfig {
|
|
4
13
|
readonly token: string;
|
|
5
14
|
symbolMap: Map<number, never>;
|
|
6
15
|
streakMap: Map<string, number>;
|
|
7
|
-
private bets;
|
|
16
|
+
private readonly bets;
|
|
8
17
|
private winMap;
|
|
9
18
|
private transformationMap;
|
|
19
|
+
/**
|
|
20
|
+
* Create instance of ApiConfig, requires InitDataInterfac
|
|
21
|
+
*
|
|
22
|
+
* @param {InitDataInterface} data
|
|
23
|
+
*/
|
|
10
24
|
constructor(data: InitDataInterface);
|
|
25
|
+
/**
|
|
26
|
+
* Getter for win line number
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
* @param winLineAnimationName
|
|
30
|
+
* @returns {string | number}
|
|
31
|
+
*/
|
|
11
32
|
getWinLineNumber(winLineAnimationName: string): number | string;
|
|
33
|
+
/**
|
|
34
|
+
* Function for getting next bet from config
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
* @param {number} currentBet current bet
|
|
38
|
+
* @returns {number}
|
|
39
|
+
*/
|
|
12
40
|
getNextBet(currentBet: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* Function for getting previous bet from config
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
* @param {number} currentBet current bet
|
|
46
|
+
* @returns {number}
|
|
47
|
+
*/
|
|
13
48
|
getPreviousBet(currentBet: number): number;
|
|
49
|
+
/**
|
|
50
|
+
* Getting first bet from config
|
|
51
|
+
* This functions is use for mechanic that getting the first available bet
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
* @returns {number}
|
|
55
|
+
*/
|
|
14
56
|
getFirstBet(): number;
|
|
57
|
+
/**
|
|
58
|
+
* Getting highest bet in config
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
* @param {number} [limit=Number.POSITIVE_INFINITY] limit for the biggest available bet
|
|
62
|
+
* @returns {number}
|
|
63
|
+
*/
|
|
15
64
|
getHighestBet(limit?: number): number;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Mapper for symbolIds present in the game
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
* @param {number} backendSymbolId id from backend to map
|
|
70
|
+
* @returns {SymbolId}
|
|
71
|
+
*/
|
|
72
|
+
getSymbolId(backendSymbolId: number): SymbolId;
|
|
73
|
+
/**
|
|
74
|
+
* Function that maps backend win id into more readable one
|
|
75
|
+
*
|
|
76
|
+
* @public
|
|
77
|
+
* @param {number} backendWinId
|
|
78
|
+
* @returns {WinTypeId}
|
|
79
|
+
*/
|
|
80
|
+
getWinId(backendWinId: number): WinTypeId;
|
|
81
|
+
/**
|
|
82
|
+
* Function that maps backend win id into more readable one
|
|
83
|
+
*
|
|
84
|
+
* @public
|
|
85
|
+
* @param {number} transformationBackendId
|
|
86
|
+
* @returns {TransformationTypeId}
|
|
87
|
+
*/
|
|
88
|
+
getTransformationById(transformationBackendId: number): TransformationTypeId;
|
|
89
|
+
/**
|
|
90
|
+
* Mapper for symbol ids into symbol names
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
* @param {number[][]} symbols_on_reels
|
|
94
|
+
* @returns {SymbolId[]}
|
|
95
|
+
*/
|
|
19
96
|
mapSymbolIdsToSymbolNames(symbols_on_reels: number[][]): SymbolId[];
|
|
97
|
+
/**
|
|
98
|
+
* Getter for bet that placed in current position
|
|
99
|
+
*
|
|
100
|
+
* @private
|
|
101
|
+
* @param {number} primaryPosition
|
|
102
|
+
* @param {number} fallbackPosition
|
|
103
|
+
* @returns {number}
|
|
104
|
+
*/
|
|
20
105
|
private getBetAtPosition;
|
|
106
|
+
/**
|
|
107
|
+
* Method for initializing symbol map in game
|
|
108
|
+
*
|
|
109
|
+
* @private
|
|
110
|
+
* @param {InitDataInterface} data
|
|
111
|
+
*/
|
|
21
112
|
private initSymbolMap;
|
|
113
|
+
/**
|
|
114
|
+
* Method for initializing streak map in game
|
|
115
|
+
*
|
|
116
|
+
* @private
|
|
117
|
+
* @param {InitDataInterface} data
|
|
118
|
+
*/
|
|
22
119
|
private initStreakMap;
|
|
120
|
+
/**
|
|
121
|
+
* Method for initializing win map in game
|
|
122
|
+
*
|
|
123
|
+
* @private
|
|
124
|
+
* @param {InitDataInterface} data
|
|
125
|
+
*/
|
|
23
126
|
private initWinMap;
|
|
127
|
+
/**
|
|
128
|
+
* Method for initializing transformation map in game
|
|
129
|
+
*
|
|
130
|
+
* @private
|
|
131
|
+
* @param {InitDataInterface} data
|
|
132
|
+
*/
|
|
24
133
|
private initTransformationMap;
|
|
25
134
|
}
|