@truelab/truengine 0.0.1-0

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 (122) hide show
  1. package/dist/truengine.es.js +35354 -0
  2. package/dist/types/index.d.ts +2 -0
  3. package/dist/types/src/classes/assets.class.d.ts +89 -0
  4. package/dist/types/src/classes/bitmap.text.class.d.ts +77 -0
  5. package/dist/types/src/classes/borderview.class.d.ts +204 -0
  6. package/dist/types/src/classes/color.class.d.ts +72 -0
  7. package/dist/types/src/classes/container.class.d.ts +111 -0
  8. package/dist/types/src/classes/di.class.d.ts +110 -0
  9. package/dist/types/src/classes/emitter.class.d.ts +64 -0
  10. package/dist/types/src/classes/engine.class.d.ts +75 -0
  11. package/dist/types/src/classes/loaders.class.d.ts +28 -0
  12. package/dist/types/src/classes/preloader.class.d.ts +15 -0
  13. package/dist/types/src/classes/producer.class.d.ts +135 -0
  14. package/dist/types/src/classes/sequence.class.d.ts +30 -0
  15. package/dist/types/src/classes/skipable.class.d.ts +15 -0
  16. package/dist/types/src/classes/spine.assets.class.d.ts +42 -0
  17. package/dist/types/src/classes/tile.class.d.ts +38 -0
  18. package/dist/types/src/components/abstract.component.d.ts +52 -0
  19. package/dist/types/src/components/abstract.html.component.d.ts +43 -0
  20. package/dist/types/src/components/bigwin.component.d.ts +109 -0
  21. package/dist/types/src/components/blackout.component.d.ts +32 -0
  22. package/dist/types/src/components/button.component.d.ts +113 -0
  23. package/dist/types/src/components/button.faded.component.d.ts +29 -0
  24. package/dist/types/src/components/button.text.component.d.ts +49 -0
  25. package/dist/types/src/components/cheat.component.d.ts +63 -0
  26. package/dist/types/src/components/fillframe.component.d.ts +37 -0
  27. package/dist/types/src/components/fps.component.d.ts +39 -0
  28. package/dist/types/src/components/grid.component.d.ts +28 -0
  29. package/dist/types/src/components/link.component.d.ts +78 -0
  30. package/dist/types/src/components/particles.component.d.ts +30 -0
  31. package/dist/types/src/components/progress.component.d.ts +42 -0
  32. package/dist/types/src/components/slideshow/slides.reel.component.d.ts +65 -0
  33. package/dist/types/src/components/slideshow/slideshow.component.d.ts +27 -0
  34. package/dist/types/src/components/slideshow/slideshow.ui.component.d.ts +28 -0
  35. package/dist/types/src/components/slideshow/slideshow.ui.pagination.d.ts +30 -0
  36. package/dist/types/src/components/slot/coefficient/coefficient.component.d.ts +66 -0
  37. package/dist/types/src/components/slot/frames/frames.component.d.ts +39 -0
  38. package/dist/types/src/components/slot/frames/frames.sequence.component.d.ts +17 -0
  39. package/dist/types/src/components/slot/frames/frames.spine.component.d.ts +21 -0
  40. package/dist/types/src/components/slot/hints/hints.component.d.ts +102 -0
  41. package/dist/types/src/components/slot/intrigue/intrigue.component.d.ts +41 -0
  42. package/dist/types/src/components/slot/intrigue/intrigue.spine.component.d.ts +18 -0
  43. package/dist/types/src/components/slot/lines/lines.component.d.ts +29 -0
  44. package/dist/types/src/components/slot/lines/lines.static.component.d.ts +38 -0
  45. package/dist/types/src/components/slot/reel.component.d.ts +253 -0
  46. package/dist/types/src/components/slot/slot.cheats.d.ts +22 -0
  47. package/dist/types/src/components/slot/slot.component.d.ts +132 -0
  48. package/dist/types/src/components/slot/slot.config.d.ts +82 -0
  49. package/dist/types/src/components/slot/symbol/symbol.component.d.ts +84 -0
  50. package/dist/types/src/components/slot/symbol/symbol.sequence.component.d.ts +18 -0
  51. package/dist/types/src/components/slot/symbol/symbol.spine.component.d.ts +18 -0
  52. package/dist/types/src/components/switch.component.d.ts +62 -0
  53. package/dist/types/src/components/text.component.d.ts +101 -0
  54. package/dist/types/src/components/volatility/volatility.component.d.ts +55 -0
  55. package/dist/types/src/components/volatility/volatility.symbol.component.d.ts +20 -0
  56. package/dist/types/src/extends/enum.types.d.ts +36 -0
  57. package/dist/types/src/extends/interfaces.d.ts +74 -0
  58. package/dist/types/src/extends/javascript.d.ts +5 -0
  59. package/dist/types/src/extends/short.types.d.ts +68 -0
  60. package/dist/types/src/extends/struct.types.d.ts +260 -0
  61. package/dist/types/src/functions/agent.funcs.d.ts +84 -0
  62. package/dist/types/src/functions/animate/counter.func.d.ts +10 -0
  63. package/dist/types/src/functions/animate/fadein.func.d.ts +8 -0
  64. package/dist/types/src/functions/animate/fadeout.func.d.ts +8 -0
  65. package/dist/types/src/functions/animate/from.func.d.ts +10 -0
  66. package/dist/types/src/functions/animate/fromto.func.d.ts +11 -0
  67. package/dist/types/src/functions/animate/to.func.d.ts +10 -0
  68. package/dist/types/src/functions/array/indexofall.func.d.ts +2 -0
  69. package/dist/types/src/functions/array/position.func.d.ts +6 -0
  70. package/dist/types/src/functions/array/unique.func.d.ts +6 -0
  71. package/dist/types/src/functions/arraysintersect.func.d.ts +2 -0
  72. package/dist/types/src/functions/cache.funcs.d.ts +20 -0
  73. package/dist/types/src/functions/cheats.func.d.ts +2 -0
  74. package/dist/types/src/functions/convert/tofixed.func.d.ts +9 -0
  75. package/dist/types/src/functions/debug/container.func.d.ts +7 -0
  76. package/dist/types/src/functions/debug/line.func.d.ts +10 -0
  77. package/dist/types/src/functions/demotexture.func.d.ts +3 -0
  78. package/dist/types/src/functions/dom.funcs.d.ts +6 -0
  79. package/dist/types/src/functions/draw/canvasExtract.func.d.ts +16 -0
  80. package/dist/types/src/functions/draw/gradient.texture.func.d.ts +14 -0
  81. package/dist/types/src/functions/draw/radialGradient.func.d.ts +20 -0
  82. package/dist/types/src/functions/draw/rect.func.d.ts +12 -0
  83. package/dist/types/src/functions/draw/reel.func.d.ts +9 -0
  84. package/dist/types/src/functions/engine.funcs.d.ts +63 -0
  85. package/dist/types/src/functions/is.funcs.d.ts +16 -0
  86. package/dist/types/src/functions/math.funcs.d.ts +38 -0
  87. package/dist/types/src/functions/number/between.func.d.ts +7 -0
  88. package/dist/types/src/functions/object/deepMerge.d.ts +7 -0
  89. package/dist/types/src/functions/random/exclude.func.d.ts +6 -0
  90. package/dist/types/src/functions/random/inrange.func.d.ts +6 -0
  91. package/dist/types/src/functions/random/value.func.d.ts +10 -0
  92. package/dist/types/src/functions/range.func.d.ts +3 -0
  93. package/dist/types/src/functions/speed/duration.func.d.ts +6 -0
  94. package/dist/types/src/functions/speed/mode.func.d.ts +7 -0
  95. package/dist/types/src/functions/time/full.func.d.ts +4 -0
  96. package/dist/types/src/functions/time/nowfull.func.d.ts +4 -0
  97. package/dist/types/src/functions/time/nowshort.func.d.ts +5 -0
  98. package/dist/types/src/functions/time/short.func.d.ts +7 -0
  99. package/dist/types/src/functions/timeline/create.funcs.d.ts +8 -0
  100. package/dist/types/src/functions/timeline/taps.func.d.ts +4 -0
  101. package/dist/types/src/functions/window/add.func.d.ts +7 -0
  102. package/dist/types/src/functions/window/get.func.d.ts +6 -0
  103. package/dist/types/src/index.d.ts +62 -0
  104. package/dist/types/src/plugins/dragon.bones/functions.d.ts +18 -0
  105. package/dist/types/src/plugins/dragon.bones/library.d.ts +875 -0
  106. package/dist/types/src/plugins/gsap/custom.ease.plugin.d.ts +2 -0
  107. package/dist/types/src/plugins/gsap/motion.path.plugin.d.ts +2 -0
  108. package/dist/types/src/plugins/modernizr/modernizr-custom.d.ts +1 -0
  109. package/dist/types/src/references.d.ts +4 -0
  110. package/dist/types/src/scenes/abstract.scene.d.ts +73 -0
  111. package/dist/types/src/scenes/background.scene.d.ts +35 -0
  112. package/dist/types/src/scenes/masked.scene.d.ts +15 -0
  113. package/dist/types/src/services/focus.services.d.ts +17 -0
  114. package/dist/types/src/services/iframe.service.d.ts +27 -0
  115. package/dist/types/src/services/langs.service.d.ts +31 -0
  116. package/dist/types/src/services/registry.service.d.ts +29 -0
  117. package/dist/types/src/services/settings.service.d.ts +51 -0
  118. package/dist/types/src/services/skip.service.d.ts +51 -0
  119. package/dist/types/src/services/sounds/sounds.service.d.ts +111 -0
  120. package/dist/types/src/services/storage.service.d.ts +38 -0
  121. package/dist/types/vite.config.d.ts +2 -0
  122. package/package.json +33 -0
@@ -0,0 +1,30 @@
1
+ import { Sprite } from 'pixi.js';
2
+ import { TPixiTexture, TSupportContainer } from '../../extends/short.types';
3
+ import { AbstractComponent } from '../abstract.component';
4
+ export type TConfigPagination = {
5
+ assetName: string;
6
+ textureActive: string;
7
+ textureOrigin: string;
8
+ offset: number;
9
+ pagesAmount: number;
10
+ };
11
+ /** Component pagination for slideshow */
12
+ export declare class SlideshowUiPagination extends AbstractComponent {
13
+ protected _config: TConfigPagination;
14
+ protected _buttons: Sprite[];
15
+ protected _activePagination: number;
16
+ protected _textureActive: TPixiTexture;
17
+ protected _textureOrigin: TPixiTexture;
18
+ /** Gets index active button */
19
+ get activeButton(): number;
20
+ /** Sets index of active button */
21
+ set activeButton(value: number);
22
+ /** @constructor */
23
+ constructor(config: TConfigPagination);
24
+ /** @inheritdoc */
25
+ create(instance: TSupportContainer): Promise<this>;
26
+ /** @inheritdoc */
27
+ destroy(): Promise<this>;
28
+ /** @inheritdoc */
29
+ draw(modeChanged?: boolean): Promise<this>;
30
+ }
@@ -0,0 +1,66 @@
1
+ import { BitmapText, TBitmapTextOptions } from '../../../classes/bitmap.text.class';
2
+ import { IComponent } from '../../../extends/interfaces';
3
+ import { TGsapTimeline, TPixiPoint, TSupportContainer } from '../../../extends/short.types';
4
+ import { TPoint } from '../../../extends/struct.types';
5
+ import { AbstractComponent } from '../../abstract.component';
6
+ import { TextComponent } from '../../text.component';
7
+ import * as PIXI from 'pixi.js';
8
+ export type ICoefficientComponent = {
9
+ total: (coefficient: number) => Promise<void>;
10
+ line: (coefficient: number, position: number) => Promise<void>;
11
+ break: () => void;
12
+ } & IComponent;
13
+ export type TConfigCoefficientComponent = {
14
+ enabled?: boolean;
15
+ grid?: Map<number, TPixiPoint>;
16
+ bitmap?: boolean;
17
+ fastModeTimeScale?: number;
18
+ total?: {
19
+ style?: PIXI.TextStyle | TBitmapTextOptions;
20
+ position?: TPixiPoint;
21
+ offset?: TPoint;
22
+ durationDisplay?: number;
23
+ initial?: gsap.TweenVars;
24
+ animateShow?: gsap.TweenVars;
25
+ animateHide?: gsap.TweenVars;
26
+ };
27
+ line?: {
28
+ style?: PIXI.TextStyle | TBitmapTextOptions;
29
+ position?: TPixiPoint;
30
+ iReel?: number;
31
+ offset?: TPoint;
32
+ durationDisplay?: number;
33
+ initial?: gsap.TweenVars;
34
+ animateShow?: gsap.TweenVars;
35
+ animateHide?: gsap.TweenVars;
36
+ };
37
+ };
38
+ /** Win coefficient component */
39
+ export declare class FWCoefficientComponent extends AbstractComponent implements ICoefficientComponent {
40
+ protected _config: TConfigCoefficientComponent;
41
+ protected _textFont: TextComponent;
42
+ protected _textBitmap: BitmapText;
43
+ protected _timeline: TGsapTimeline;
44
+ /** Gets text object */
45
+ protected get _text(): TextComponent | BitmapText;
46
+ /** @constructor */
47
+ constructor(config: TConfigCoefficientComponent);
48
+ /** @inheritdoc */
49
+ create(instance?: TSupportContainer): Promise<this>;
50
+ /** Sets style */
51
+ protected setStyle(style: PIXI.TextStyle | TBitmapTextOptions): void;
52
+ /** Prepares text object to total animation */
53
+ protected prepareTotal(coefficient: number): void;
54
+ /** Prepares text object to line animation */
55
+ protected prepareLine(coefficient: number, position: number): void;
56
+ /** Animates total coefficient */
57
+ total(coefficient: number): Promise<void>;
58
+ /** Animates line coefficient */
59
+ line(coefficient: number, position: number): Promise<void>;
60
+ /** Breaks animation */
61
+ break(): void;
62
+ /** @inheritdoc */
63
+ draw(): Promise<this>;
64
+ /** @inheritdoc */
65
+ destroy(): Promise<this>;
66
+ }
@@ -0,0 +1,39 @@
1
+ import { Sequence } from '../../../classes/sequence.class';
2
+ import { Spine } from '../../../classes/spine.assets.class';
3
+ import { IComponent } from '../../../extends/interfaces';
4
+ import { TNumberArray, TPixiPoint } from '../../../extends/short.types';
5
+ import { AbstractComponent } from '../../abstract.component';
6
+ export type IFramesComponent = {
7
+ start: (positions: TNumberArray) => Promise<void>;
8
+ break: () => void;
9
+ } & IComponent;
10
+ export type TConfigFramesComponent = {
11
+ enabled?: boolean;
12
+ grid?: Map<number, TPixiPoint>;
13
+ assetName?: string;
14
+ animationName?: string;
15
+ scale?: number;
16
+ timeScale?: [number, number];
17
+ };
18
+ /** Frames components */
19
+ export declare abstract class FWFramesComponent extends AbstractComponent {
20
+ protected _config: TConfigFramesComponent;
21
+ protected _frames: Map<number, Spine | Sequence>;
22
+ /** @constructor */
23
+ constructor(config: TConfigFramesComponent);
24
+ /** Destroys frames */
25
+ protected destroyFrames(): void;
26
+ /** @inheritdoc */
27
+ draw(): Promise<this>;
28
+ /** @inheritdoc */
29
+ destroy(): Promise<this>;
30
+ /**
31
+ * Animates single frame
32
+ * Calculates duration
33
+ */
34
+ protected animateFrame(_position: number): void;
35
+ /** Starts animations */
36
+ abstract start(_positions: TNumberArray): Promise<void>;
37
+ /** Breaks animations */
38
+ abstract break(): void;
39
+ }
@@ -0,0 +1,17 @@
1
+ import { Sequence } from '../../../classes/sequence.class';
2
+ import { TGsapTimeline, TNumberArray } from '../../../extends/short.types';
3
+ import { FWFramesComponent, IFramesComponent } from './frames.component';
4
+ /** Frames component with sequence animations */
5
+ export declare class FWFramesSequenceComponent extends FWFramesComponent implements IFramesComponent {
6
+ protected _frames: Map<number, Sequence>;
7
+ protected _duration: number;
8
+ protected _breakableSleep: TGsapTimeline;
9
+ /** Starts frames animations */
10
+ start(positions: TNumberArray): Promise<void>;
11
+ /** @inheritdoc */
12
+ break(): void;
13
+ /** @inheritdoc */
14
+ animateFrame(position: number): void;
15
+ /** Stops animations */
16
+ stop(): void;
17
+ }
@@ -0,0 +1,21 @@
1
+ import { Spine } from '../../../classes/spine.assets.class';
2
+ import { TNumberArray, TSupportContainer } from '../../../extends/short.types';
3
+ import { FWFramesComponent, IFramesComponent } from './frames.component';
4
+ /** Frames spine component */
5
+ export declare class FWFramesSpineComponent extends FWFramesComponent implements IFramesComponent {
6
+ protected _spines: Spine[];
7
+ protected _animation: Spine;
8
+ protected _durationMS: number;
9
+ protected _promise: Promise<void>;
10
+ protected _resolve: CallableFunction;
11
+ /** @inheritdoc */
12
+ create(instance?: TSupportContainer): Promise<this>;
13
+ /** @inheritdoc */
14
+ start(positions: TNumberArray): Promise<void>;
15
+ /** */
16
+ break(): void;
17
+ /** @inheritdoc */
18
+ destroy(): Promise<this>;
19
+ /** */
20
+ protected _destroyAnimations(): void;
21
+ }
@@ -0,0 +1,102 @@
1
+ import { IComponent } from '../../../extends/interfaces';
2
+ import { TMixedObject, TNumberArrays, TPixiPoint, TPixiSprite, TPixiTexture, TSupportContainer } from '../../../extends/short.types';
3
+ import { TPoint } from '../../../extends/struct.types';
4
+ import { AbstractComponent } from '../../abstract.component';
5
+ import * as PIXI from 'pixi.js';
6
+ export type IHintsComponent = {
7
+ open: (iReel: number, iRow: number, code: number) => Promise<void>;
8
+ close: () => Promise<void>;
9
+ } & IComponent;
10
+ export declare enum EHintPropertyStyle {
11
+ lengths = "styleLengths",
12
+ bets = "styleBets",
13
+ description = "styleDescription"
14
+ }
15
+ export declare enum EHintPropertyPosition {
16
+ plate = "plate",
17
+ lengths = "lengths",
18
+ bets = "bets",
19
+ description = "description"
20
+ }
21
+ export declare enum EHintSort {
22
+ asc = 0,
23
+ desc = 1
24
+ }
25
+ export type THintTransform = {
26
+ position?: {
27
+ plate?: TPoint;
28
+ lengths?: TPoint;
29
+ bets?: TPoint;
30
+ description?: TPoint;
31
+ };
32
+ styleLengths?: PIXI.TextStyle;
33
+ styleBets?: PIXI.TextStyle;
34
+ styleDescription?: PIXI.TextStyle;
35
+ };
36
+ export type TConfigHintsComponent = {
37
+ enabled?: boolean;
38
+ grid?: TPixiPoint[][];
39
+ width?: number;
40
+ height?: number;
41
+ shouldReflect?: boolean;
42
+ events?: boolean;
43
+ assetsName?: {
44
+ plate?: string;
45
+ symbols?: string;
46
+ };
47
+ texturesNames?: {
48
+ plate?: string;
49
+ symbols?: [number, string][];
50
+ };
51
+ textures?: {
52
+ symbols?: Map<number, TPixiTexture>;
53
+ };
54
+ paytable?: TNumberArrays;
55
+ startLength?: number;
56
+ numReels?: number;
57
+ sort?: EHintSort;
58
+ descriptions?: Map<number, string>;
59
+ betsSuffix?: string;
60
+ styleLengths?: TMixedObject;
61
+ styleBets?: TMixedObject;
62
+ styleDescription?: TMixedObject;
63
+ transform?: {
64
+ left?: THintTransform;
65
+ right?: THintTransform;
66
+ };
67
+ transformSymbols?: {
68
+ left?: Map<number, THintTransform>;
69
+ right?: Map<number, THintTransform>;
70
+ };
71
+ };
72
+ /** Hints component */
73
+ export declare class FWHintsComponent extends AbstractComponent implements IHintsComponent {
74
+ protected _config: TConfigHintsComponent;
75
+ protected _hintContainer: PIXI.Container;
76
+ protected _spritePlate: TPixiSprite;
77
+ protected _spriteSymbol: TPixiSprite;
78
+ protected _textLengths: PIXI.Text;
79
+ protected _textBets: PIXI.Text;
80
+ protected _textDescription: PIXI.Text;
81
+ protected _current: {
82
+ iReel: number;
83
+ iRow: number;
84
+ code: number;
85
+ };
86
+ /** @constructor */
87
+ constructor(config: TConfigHintsComponent);
88
+ /** @inheritdoc */
89
+ create(instance?: TSupportContainer): Promise<this>;
90
+ /** @inheritdoc */
91
+ draw(): Promise<this>;
92
+ /** @inheritdoc */
93
+ destroy(): Promise<this>;
94
+ /** Opens hint */
95
+ open(iReel: number, iRow: number, code: number): Promise<void>;
96
+ /** Get actual property position */
97
+ protected _getPosition(property: EHintPropertyPosition, iReel: number, code: number): TPoint;
98
+ /** Get actual property style */
99
+ protected _getStyle(property: EHintPropertyStyle, iReel: number, code: number): PIXI.TextStyle | TMixedObject;
100
+ /** Closes hint */
101
+ close(): Promise<void>;
102
+ }
@@ -0,0 +1,41 @@
1
+ import { IComponent } from '../../../extends/interfaces';
2
+ import { TPixiPoint } from '../../../extends/short.types';
3
+ import { TPoint } from '../../../extends/struct.types';
4
+ import { AbstractComponent } from '../../abstract.component';
5
+ export type IIntrigueComponent = {
6
+ start(reel: number): void;
7
+ stop(reel?: number): void;
8
+ } & IComponent;
9
+ export type TConfigIntrigueComponent = {
10
+ enabled?: boolean;
11
+ enabledFastMode?: boolean;
12
+ grid?: Map<number, TPixiPoint>;
13
+ assetName?: string;
14
+ animationName?: string;
15
+ scale?: TPoint;
16
+ offset?: TPoint;
17
+ durationFadeIn?: [number, number];
18
+ durationFadeOut?: [number, number];
19
+ events?: {
20
+ start?: boolean;
21
+ stop?: boolean;
22
+ };
23
+ motion?: {
24
+ timeScale?: [number, number];
25
+ duration?: [number, number];
26
+ delay?: [number, number];
27
+ ease?: string;
28
+ };
29
+ };
30
+ /** Intrigue component */
31
+ export declare abstract class FWIntrigueComponent extends AbstractComponent implements IIntrigueComponent {
32
+ protected _config: TConfigIntrigueComponent;
33
+ /** @constructor */
34
+ constructor(config: TConfigIntrigueComponent);
35
+ /** @inheritdoc */
36
+ draw(): Promise<this>;
37
+ /** Starts intrigue */
38
+ abstract start(_reel: number): void;
39
+ /** Stops intrigue */
40
+ abstract stop(): void;
41
+ }
@@ -0,0 +1,18 @@
1
+ import { Spine } from '../../../classes/spine.assets.class';
2
+ import { TGsapTween, TSupportContainer } from '../../../extends/short.types';
3
+ import { FWIntrigueComponent } from './intrigue.component';
4
+ /** Intrigue component with spine animation */
5
+ export declare class FWIntrigueSpineComponent extends FWIntrigueComponent {
6
+ protected _animation: Spine;
7
+ protected _tweenFade: TGsapTween;
8
+ protected _iReel: number;
9
+ protected _isProcessing: boolean;
10
+ /** @inheritdoc */
11
+ create(instance?: TSupportContainer): Promise<this>;
12
+ /** @inheritdoc */
13
+ start(iReel: number): Promise<void>;
14
+ /** @inheritdoc */
15
+ stop(_iReel?: number): Promise<void>;
16
+ /** @inheritdoc */
17
+ destroy(): Promise<this>;
18
+ }
@@ -0,0 +1,29 @@
1
+ import { IComponent } from '../../../extends/interfaces';
2
+ import { TNumberArray, TPixiPoint } from '../../../extends/short.types';
3
+ import { AbstractComponent } from '../../abstract.component';
4
+ import { TLinesStaticConfig } from './lines.static.component';
5
+ export type ILinesComponent = {
6
+ animate: (line: TNumberArray) => Promise<void>;
7
+ break: () => void;
8
+ } & IComponent;
9
+ export type TConfigLinesComponent = {
10
+ enabled?: boolean;
11
+ grid?: Map<number, TPixiPoint>;
12
+ frames?: boolean;
13
+ coefficient?: boolean;
14
+ static?: TLinesStaticConfig;
15
+ };
16
+ /** Lines component */
17
+ export declare abstract class FWLinesComponent extends AbstractComponent {
18
+ protected _config: TConfigLinesComponent;
19
+ /** @constructor */
20
+ constructor(config: TConfigLinesComponent);
21
+ /** @inheritdoc */
22
+ draw(): Promise<this>;
23
+ /** @inheritdoc */
24
+ destroy(): Promise<this>;
25
+ /** Animates line */
26
+ animate(_line: TNumberArray): Promise<void>;
27
+ /** Brakes animation */
28
+ break(): void;
29
+ }
@@ -0,0 +1,38 @@
1
+ import { Container } from '../../../classes/container.class';
2
+ import { TGsapTimeline, TNumberArray, TPixiSprite, TStringArray, TSupportContainer } from '../../../extends/short.types';
3
+ import { TPoint } from '../../../extends/struct.types';
4
+ import { FWLinesComponent } from './lines.component';
5
+ export type TLineSprite = TPixiSprite & {
6
+ length?: number;
7
+ };
8
+ export type TLinesStaticConfig = {
9
+ assetName?: string;
10
+ textures?: TStringArray;
11
+ numRows?: number;
12
+ offset?: TPoint;
13
+ duration?: {
14
+ display?: number;
15
+ fadeIn?: number;
16
+ fadeOut?: number;
17
+ };
18
+ };
19
+ /** Lines static component */
20
+ export declare class FWLinesStaticComponent extends FWLinesComponent {
21
+ protected _container: Container;
22
+ protected _sprites: TLineSprite[][];
23
+ protected _timeline: TGsapTimeline;
24
+ /** @inheritdoc */
25
+ create(instance?: TSupportContainer): Promise<this>;
26
+ /** Animates line */
27
+ animate(line: TNumberArray): Promise<void>;
28
+ /** Returns sprites with calculated angles and positions */
29
+ protected _getSprites(line: TNumberArray): TLineSprite[];
30
+ /** Sprite factory method */
31
+ protected _getSprite(length: number): TPixiSprite;
32
+ /** Brakes animation */
33
+ break(): void;
34
+ /** Gets iRow by position */
35
+ getRowByPosition(position: number): number;
36
+ /** @inheritdoc */
37
+ destroy(): Promise<this>;
38
+ }
@@ -0,0 +1,253 @@
1
+ import { Container } from '../../classes/container.class';
2
+ import { IComponent } from '../../extends/interfaces';
3
+ import { TGsapTimeline, TGsapTween, TNumberArray, TNumberArrays, TPixiSprite, TSupportContainer } from '../../extends/short.types';
4
+ import { TSymbolMoveBase } from '../../extends/struct.types';
5
+ import { AbstractComponent } from '../abstract.component';
6
+ import { TConfigIntrigueComponent } from './intrigue/intrigue.component';
7
+ import { ISlotFactory, TSoundEventOptions } from './slot.config';
8
+ import { ISymbolComponent, TConfigSymbolComponent } from './symbol/symbol.component';
9
+ export type IReelComponent = {
10
+ iReel: number;
11
+ getSymbols: () => TNumberArray;
12
+ setSymbols: (codes: TNumberArray) => void;
13
+ getSymbol: (iRow: number) => ISymbolComponent;
14
+ getIndexes: () => TNumberArray;
15
+ getIRowFromIndex: (index: number) => number;
16
+ start: () => Promise<void>;
17
+ stop: (stopCodes?: TNumberArray, hasIntrigue?: boolean) => Promise<void>;
18
+ move: (positions: TSymbolMoveBase[], playingReelIdx?: number) => Promise<void>;
19
+ refill: (symbolCodes: TNumberArray, positions: TNumberArray, playingIndex?: number, hasIntrigue?: boolean) => Promise<void>;
20
+ moveAndRefill: (symbolCodes: TNumberArray, positionsIn: TNumberArray, positionsMove: TSymbolMoveBase[], playingReelIdx?: number, hasIntrigue?: boolean) => Promise<void>;
21
+ break: () => void;
22
+ } & IComponent;
23
+ export declare enum EGameAnimationType {
24
+ slot = "slot",
25
+ cascade = "cascade"
26
+ }
27
+ export declare enum EMotionType {
28
+ clear = "clear",
29
+ fall = "fall",
30
+ move = "move",
31
+ refill = "refill"
32
+ }
33
+ type TSymbolMotionConfig = {
34
+ type: EMotionType;
35
+ symbol: ISymbolComponent;
36
+ toPosition?: number;
37
+ playingRowIdx?: number;
38
+ playingReelIdx?: number;
39
+ relativeDistanceIdx?: number;
40
+ hasIntrigue?: boolean;
41
+ };
42
+ type TCascadeTimings = {
43
+ timeScale?: [number, number];
44
+ distance?: [number, number];
45
+ duration?: [number, number];
46
+ enableMotion?: [number, number];
47
+ disableMotion?: [number, number];
48
+ reelsDelay?: [number, number];
49
+ rowsDelay?: [number, number];
50
+ ease?: gsap.EaseFunction;
51
+ };
52
+ export type TConfigReelComponent = {
53
+ factory?: ISlotFactory;
54
+ animationType?: EGameAnimationType;
55
+ numRows?: number;
56
+ intrigue?: {
57
+ onStop?: boolean;
58
+ onRefill?: boolean;
59
+ numScattersToStart?: number;
60
+ numScattersToEnd?: number;
61
+ scatterCode?: number;
62
+ reelsIntrigueDelay?: [number, number];
63
+ rowsIntrigueDelay?: [number, number];
64
+ };
65
+ symbolsOrder?: {
66
+ /** Порядок символов на барабане по умолчанию [0, ..., numRows - 1] */
67
+ default?: TNumberArray;
68
+ /** Приоритетные коды символов по возрастанию */
69
+ top?: TNumberArray;
70
+ };
71
+ randomizer?: TNumberArrays;
72
+ autoStopSymbolsAnimations?: boolean;
73
+ mask?: {
74
+ width?: number;
75
+ height?: number;
76
+ gradientTop?: number;
77
+ gradientBottom?: number;
78
+ offsetTop?: number;
79
+ offsetBottom?: number;
80
+ };
81
+ cascade?: {
82
+ refillAwaitsMove?: boolean;
83
+ skipTimeScale?: number;
84
+ /** с одинаковой ли высоты будут падать символы, или она будет считаться относительно iRow */
85
+ distanceRelative?: boolean;
86
+ bySymbols?: {
87
+ enabled?: boolean;
88
+ symbolsOrder?: TNumberArray;
89
+ };
90
+ byReels?: {
91
+ reelsOrder?: TNumberArray;
92
+ };
93
+ bounce?: {
94
+ distance?: [number, number];
95
+ durationDown?: [number, number];
96
+ durationUp?: [number, number];
97
+ scaleX?: [number, number];
98
+ scaleY?: [number, number];
99
+ easeDown?: string;
100
+ easeUp?: string;
101
+ };
102
+ };
103
+ timings?: {
104
+ spin?: {
105
+ motion?: [number, number];
106
+ bounceDown?: [number, number];
107
+ bounceUp?: [number, number];
108
+ };
109
+ cascade?: {
110
+ clear?: TCascadeTimings;
111
+ fall?: TCascadeTimings;
112
+ move?: TCascadeTimings;
113
+ refill?: TCascadeTimings;
114
+ };
115
+ };
116
+ events?: {
117
+ start?: boolean;
118
+ stop?: boolean;
119
+ bounce?: boolean;
120
+ spawn?: boolean;
121
+ };
122
+ bounceOffset?: number;
123
+ shouldDisplayBounceFakeSymbols?: boolean;
124
+ components?: {
125
+ symbol: TConfigSymbolComponent;
126
+ intrigue?: TConfigIntrigueComponent;
127
+ };
128
+ sounds?: {
129
+ symbolsStop: Map<number, string>;
130
+ };
131
+ randomGap?: number;
132
+ };
133
+ /** Reel component */
134
+ export declare class FWReelComponent extends AbstractComponent implements IReelComponent {
135
+ iReel: number;
136
+ protected _config: TConfigReelComponent;
137
+ protected _symbolsContainer: Container;
138
+ protected _symbols: ISymbolComponent[];
139
+ protected _mask: TPixiSprite;
140
+ protected _gridY: TNumberArray;
141
+ protected _stopCodesInitial: TNumberArray;
142
+ protected _stopCodesStack: TNumberArray;
143
+ protected _isMotion: boolean;
144
+ protected _isStopProcessing: boolean;
145
+ protected _tlMotion: TGsapTimeline;
146
+ protected _playingSounds: TSoundEventOptions[];
147
+ protected _breakableSleep: TGsapTween;
148
+ protected _tweenTimeScale: TGsapTween;
149
+ protected _arrExceptions: TNumberArray;
150
+ /** Gets slot height */
151
+ get slotHeight(): number;
152
+ /** @constructor */
153
+ constructor(iReel: number, config: TConfigReelComponent);
154
+ /** @inheritdoc */
155
+ create(instance?: TSupportContainer): Promise<this>;
156
+ /** Получить коды символов */
157
+ getSymbols(): TNumberArray;
158
+ /**
159
+ * Задать символы на барабане
160
+ *
161
+ * - Чистим текущие анимации
162
+ * - По умолчанию ставим рандомные символы
163
+ * - Запуск idle анимаций, если они есть
164
+ */
165
+ setSymbols(codes?: TNumberArray): Promise<this>;
166
+ /** Запустить анимацию символа при остановке барабана, если анимация указана в конфиге */
167
+ animateSymbolsOnStop(): void;
168
+ /** Найти и запустить звук для старшего символа при остановке барабанаб если звук указан в конфиге */
169
+ playSoundsOnStop(stopCodes: TNumberArray): void;
170
+ /** Останавить все звуки, которые были запущены в компоненте барабана */
171
+ stopSounds(): void;
172
+ /** @inheritdoc */
173
+ draw(): Promise<this>;
174
+ /** @inheritdoc */
175
+ destroy(): Promise<this>;
176
+ /** Starts motion */
177
+ start(): Promise<void>;
178
+ /** */
179
+ protected _beforeStart(): Promise<void>;
180
+ /** */
181
+ protected _beforeStop(): Promise<void>;
182
+ /** */
183
+ protected _resetTl(): void;
184
+ /** */
185
+ protected _animateStart(): Promise<void>;
186
+ /** Stops motion */
187
+ stop(symbolsCodes?: TNumberArray, hasIntrigue?: boolean): Promise<void>;
188
+ /** */
189
+ protected _animateStopSpin(stopCodes?: TNumberArray, hasIntrigue?: boolean): Promise<void>;
190
+ /** Breaks everything for stop */
191
+ break(): void;
192
+ /** Animates motion */
193
+ protected _animateStartSpin(): Promise<void>;
194
+ /** Adds single symbol movement to motion timeline */
195
+ protected addMotion(): void;
196
+ /** Animates bounce */
197
+ protected animateBounce(): Promise<void>;
198
+ /**
199
+ * Resets reel's position
200
+ * Respawn lowest symbol
201
+ * Reorders symbols
202
+ */
203
+ protected spawn(isMotion: boolean): number;
204
+ /** */
205
+ reposition(): Promise<void>;
206
+ /** Animates intrigue */
207
+ animateIntrigue(): Promise<void>;
208
+ /** Gets symbol component */
209
+ getSymbol(iRow: number): ISymbolComponent;
210
+ /** Gets symbols indexes */
211
+ getIndexes(): TNumberArray;
212
+ /** */
213
+ getIRowFromIndex(index: number): number;
214
+ /** Sets motion timescale */
215
+ setTimeScale(value: number, vars?: gsap.TweenVars): Promise<void>;
216
+ /**
217
+ * For stop Symbols take into account the controlled randomness
218
+ */
219
+ animateMotionExceptions(stopCodes: TNumberArray): Promise<void>;
220
+ /**
221
+ * Gets random symbol code for this reel
222
+ * the symbols must not be repeated within the other two symbols on the reel
223
+ */
224
+ protected getRandomSymbolCode(): number;
225
+ /**
226
+ * adding a symbol to the exceptions to validate for the next symbol
227
+ */
228
+ protected writeException(symbol: number): void;
229
+ /** Cascade start animation */
230
+ protected _animateStartCascade(): Promise<void>;
231
+ /** Cascade start animation */
232
+ protected _animateStopCascade(symbolCodes?: TNumberArray, hasIntrigue?: boolean): Promise<void>;
233
+ /** */
234
+ moveAndRefill(symbolCodes: TNumberArray, positionsIn: TNumberArray, positionsMove?: TSymbolMoveBase[], playingReelIdx?: number, hasIntrigue?: boolean): Promise<void>;
235
+ /** */
236
+ move(positions: TSymbolMoveBase[], playingReelIdx?: number): Promise<void>;
237
+ /** */
238
+ refill(symbolCodes: TNumberArray, positions: TNumberArray, playingReelIdx?: number, hasIntrigue?: boolean): Promise<void>;
239
+ /** Main func for cascade symbols animation, includes:
240
+ * 1. intrigue delay
241
+ * 2. resets symbol position for drop if needed
242
+ * 3. main motion to the given Y position, use _motionStarted and _motionCompleted funcs if it necessary to add some logic at the start or at the finish of the motion animation
243
+ * 4. switching motion textures while moving
244
+ * 5. stop(drop) animation after finishing main move animation, uses the same func as spin stop anim
245
+ * 6. bounce anim at the end
246
+ */
247
+ protected _animateMotion(config: TSymbolMotionConfig): Promise<void>;
248
+ /** optional actions before base move animation */
249
+ protected _motionStarted(_type: EMotionType, _symbol: ISymbolComponent): void;
250
+ /** optional actions after base move animation, don't includes time for bounce */
251
+ protected _motionCompleted(_type: EMotionType, _symbol: ISymbolComponent): void;
252
+ }
253
+ export {};