@slot-engine/core 0.0.11 → 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.
- package/README.md +0 -3
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
> [!NOTE]
|
|
2
|
-
> This software **is work in progress** and may currently miss features or contain bugs. Feel free to contribute to help improve this project. Breaking changes may occur at any time.
|
|
3
|
-
|
|
4
1
|
# Slot Engine Core
|
|
5
2
|
|
|
6
3
|
Library for configuring and simulating slot games. Produces output compatible with Stake Engine / Stake RGS.
|
package/dist/index.d.mts
CHANGED
|
@@ -444,7 +444,10 @@ declare class BoardService<TGameModes extends AnyGameModes = AnyGameModes, TSymb
|
|
|
444
444
|
tumbleBoard(symbolsToDelete: Array<{
|
|
445
445
|
reelIdx: number;
|
|
446
446
|
rowIdx: number;
|
|
447
|
-
}>):
|
|
447
|
+
}>): {
|
|
448
|
+
newBoardSymbols: Record<string, GameSymbol[]>;
|
|
449
|
+
newPaddingTopSymbols: Record<string, GameSymbol[]>;
|
|
450
|
+
};
|
|
448
451
|
}
|
|
449
452
|
|
|
450
453
|
declare class Recorder {
|
|
@@ -1562,7 +1565,10 @@ declare class StandaloneBoard {
|
|
|
1562
1565
|
tumbleBoard(symbolsToDelete: Array<{
|
|
1563
1566
|
reelIdx: number;
|
|
1564
1567
|
rowIdx: number;
|
|
1565
|
-
}>):
|
|
1568
|
+
}>): {
|
|
1569
|
+
newBoardSymbols: Record<string, GameSymbol[]>;
|
|
1570
|
+
newPaddingTopSymbols: Record<string, GameSymbol[]>;
|
|
1571
|
+
};
|
|
1566
1572
|
}
|
|
1567
1573
|
interface StandaloneBoardOptions {
|
|
1568
1574
|
ctx: GameContext;
|
package/dist/index.d.ts
CHANGED
|
@@ -444,7 +444,10 @@ declare class BoardService<TGameModes extends AnyGameModes = AnyGameModes, TSymb
|
|
|
444
444
|
tumbleBoard(symbolsToDelete: Array<{
|
|
445
445
|
reelIdx: number;
|
|
446
446
|
rowIdx: number;
|
|
447
|
-
}>):
|
|
447
|
+
}>): {
|
|
448
|
+
newBoardSymbols: Record<string, GameSymbol[]>;
|
|
449
|
+
newPaddingTopSymbols: Record<string, GameSymbol[]>;
|
|
450
|
+
};
|
|
448
451
|
}
|
|
449
452
|
|
|
450
453
|
declare class Recorder {
|
|
@@ -1562,7 +1565,10 @@ declare class StandaloneBoard {
|
|
|
1562
1565
|
tumbleBoard(symbolsToDelete: Array<{
|
|
1563
1566
|
reelIdx: number;
|
|
1564
1567
|
rowIdx: number;
|
|
1565
|
-
}>):
|
|
1568
|
+
}>): {
|
|
1569
|
+
newBoardSymbols: Record<string, GameSymbol[]>;
|
|
1570
|
+
newPaddingTopSymbols: Record<string, GameSymbol[]>;
|
|
1571
|
+
};
|
|
1566
1572
|
}
|
|
1567
1573
|
interface StandaloneBoardOptions {
|
|
1568
1574
|
ctx: GameContext;
|
package/dist/index.js
CHANGED
|
@@ -702,11 +702,17 @@ var Board = class {
|
|
|
702
702
|
this.reels[reelIdx].splice(rowIdx, 1);
|
|
703
703
|
});
|
|
704
704
|
const newFirstSymbolPositions = {};
|
|
705
|
+
const newBoardSymbols = {};
|
|
706
|
+
const newPaddingTopSymbols = {};
|
|
705
707
|
for (let ridx = 0; ridx < reelsAmount; ridx++) {
|
|
706
708
|
while (this.reels[ridx].length < symbolsPerReel[ridx]) {
|
|
707
709
|
const padSymbol = this.paddingTop[ridx].pop();
|
|
708
710
|
if (padSymbol) {
|
|
709
711
|
this.reels[ridx].unshift(padSymbol);
|
|
712
|
+
if (!newBoardSymbols[ridx]) {
|
|
713
|
+
newBoardSymbols[ridx] = [];
|
|
714
|
+
}
|
|
715
|
+
newBoardSymbols[ridx].unshift(padSymbol);
|
|
710
716
|
} else {
|
|
711
717
|
break;
|
|
712
718
|
}
|
|
@@ -720,6 +726,10 @@ var Board = class {
|
|
|
720
726
|
(0, import_assert3.default)(newSymbol, "Failed to get new symbol for tumbling.");
|
|
721
727
|
this.reels[ridx].unshift(newSymbol);
|
|
722
728
|
newFirstSymbolPositions[ridx] = symbolPos;
|
|
729
|
+
if (!newBoardSymbols[ridx]) {
|
|
730
|
+
newBoardSymbols[ridx] = [];
|
|
731
|
+
}
|
|
732
|
+
newBoardSymbols[ridx].unshift(newSymbol);
|
|
723
733
|
}
|
|
724
734
|
}
|
|
725
735
|
for (let ridx = 0; ridx < reelsAmount; ridx++) {
|
|
@@ -730,8 +740,16 @@ var Board = class {
|
|
|
730
740
|
const padSymbol = reels[ridx][topPos];
|
|
731
741
|
(0, import_assert3.default)(padSymbol, "Failed to get new padding symbol for tumbling.");
|
|
732
742
|
this.paddingTop[ridx].unshift(padSymbol);
|
|
743
|
+
if (!newPaddingTopSymbols[ridx]) {
|
|
744
|
+
newPaddingTopSymbols[ridx] = [];
|
|
745
|
+
}
|
|
746
|
+
newPaddingTopSymbols[ridx].unshift(padSymbol);
|
|
733
747
|
}
|
|
734
748
|
}
|
|
749
|
+
return {
|
|
750
|
+
newBoardSymbols,
|
|
751
|
+
newPaddingTopSymbols
|
|
752
|
+
};
|
|
735
753
|
}
|
|
736
754
|
};
|
|
737
755
|
|
|
@@ -872,7 +890,7 @@ var BoardService = class extends AbstractService {
|
|
|
872
890
|
* Tumbles the board. All given symbols will be deleted and new symbols will fall from the top.
|
|
873
891
|
*/
|
|
874
892
|
tumbleBoard(symbolsToDelete) {
|
|
875
|
-
this.board.tumbleBoard({
|
|
893
|
+
return this.board.tumbleBoard({
|
|
876
894
|
ctx: this.ctx(),
|
|
877
895
|
symbolsToDelete
|
|
878
896
|
});
|
|
@@ -3576,7 +3594,7 @@ var StandaloneBoard = class {
|
|
|
3576
3594
|
* Tumbles the board. All given symbols will be deleted and new symbols will fall from the top.
|
|
3577
3595
|
*/
|
|
3578
3596
|
tumbleBoard(symbolsToDelete) {
|
|
3579
|
-
this.board.tumbleBoard({
|
|
3597
|
+
return this.board.tumbleBoard({
|
|
3580
3598
|
ctx: this.ctx,
|
|
3581
3599
|
symbolsToDelete,
|
|
3582
3600
|
reelsAmount: this.reelsAmount,
|