@slot-engine/core 0.0.8 → 0.0.10
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/index.d.mts +68 -8
- package/dist/index.d.ts +68 -8
- package/dist/index.js +394 -88
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +394 -88
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -328,6 +328,10 @@ declare class GameSymbol {
|
|
|
328
328
|
* Compares this symbol to another symbol or a set of properties.
|
|
329
329
|
*/
|
|
330
330
|
compare(symbolOrProperties?: GameSymbol | Record<string, any>): boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Creates a clone of this GameSymbol.
|
|
333
|
+
*/
|
|
334
|
+
clone(): GameSymbol;
|
|
331
335
|
}
|
|
332
336
|
interface GameSymbolOpts {
|
|
333
337
|
/**
|
|
@@ -370,6 +374,14 @@ declare class BoardService<TGameModes extends AnyGameModes = AnyGameModes, TSymb
|
|
|
370
374
|
getPaddingTop(): Reels;
|
|
371
375
|
getPaddingBottom(): Reels;
|
|
372
376
|
getAnticipation(): boolean[];
|
|
377
|
+
/**
|
|
378
|
+
* Gets the symbol at the specified reel and row index.
|
|
379
|
+
*/
|
|
380
|
+
getSymbol(reelIndex: number, rowIndex: number): GameSymbol | undefined;
|
|
381
|
+
/**
|
|
382
|
+
* Sets the symbol at the specified reel and row index.
|
|
383
|
+
*/
|
|
384
|
+
setSymbol(reelIndex: number, rowIndex: number, symbol: GameSymbol): void;
|
|
373
385
|
private resetReels;
|
|
374
386
|
/**
|
|
375
387
|
* Sets the anticipation value for a specific reel.
|
|
@@ -1171,6 +1183,7 @@ declare class WinType {
|
|
|
1171
1183
|
winCombinations: WinCombination[];
|
|
1172
1184
|
};
|
|
1173
1185
|
protected isWild(symbol: GameSymbol): boolean;
|
|
1186
|
+
protected getSymbolPayout(symbol: GameSymbol, count: number): number;
|
|
1174
1187
|
}
|
|
1175
1188
|
interface WinTypeOpts {
|
|
1176
1189
|
/**
|
|
@@ -1198,6 +1211,7 @@ interface WinTypeOpts {
|
|
|
1198
1211
|
type WinCombination = {
|
|
1199
1212
|
payout: number;
|
|
1200
1213
|
kind: number;
|
|
1214
|
+
baseSymbol: GameSymbol;
|
|
1201
1215
|
symbols: Array<{
|
|
1202
1216
|
symbol: GameSymbol;
|
|
1203
1217
|
isWild: boolean;
|
|
@@ -1226,6 +1240,7 @@ declare class LinesWinType extends WinType {
|
|
|
1226
1240
|
* Retrieve the results using `getWins()` after.
|
|
1227
1241
|
*/
|
|
1228
1242
|
evaluateWins(board: Reels): this;
|
|
1243
|
+
private getLinePayout;
|
|
1229
1244
|
}
|
|
1230
1245
|
interface LinesWinTypeOpts extends WinTypeOpts {
|
|
1231
1246
|
/**
|
|
@@ -1244,20 +1259,57 @@ interface LinesWinTypeOpts extends WinTypeOpts {
|
|
|
1244
1259
|
}
|
|
1245
1260
|
interface LineWinCombination extends WinCombination {
|
|
1246
1261
|
lineNumber: number;
|
|
1247
|
-
symbol: GameSymbol;
|
|
1248
|
-
winType: "pure-wild" | "substituted";
|
|
1249
|
-
substitutedBaseSymbol: GameSymbol | null;
|
|
1250
|
-
stats: {
|
|
1251
|
-
wildCount: number;
|
|
1252
|
-
nonWildCount: number;
|
|
1253
|
-
leadingWilds: number;
|
|
1254
|
-
};
|
|
1255
1262
|
}
|
|
1256
1263
|
|
|
1257
1264
|
declare class ClusterWinType extends WinType {
|
|
1265
|
+
protected winCombinations: ClusterWinCombination[];
|
|
1266
|
+
getWins: () => {
|
|
1267
|
+
payout: number;
|
|
1268
|
+
winCombinations: ClusterWinCombination[];
|
|
1269
|
+
};
|
|
1270
|
+
private _checked;
|
|
1271
|
+
private _checkedWilds;
|
|
1272
|
+
private _currentBoard;
|
|
1273
|
+
constructor(opts: ClusterWinTypeOpts);
|
|
1274
|
+
private validateConfig;
|
|
1275
|
+
/**
|
|
1276
|
+
* Calculates wins based on symbol cluster size and provided board state.\
|
|
1277
|
+
* Retrieve the results using `getWins()` after.
|
|
1278
|
+
*/
|
|
1279
|
+
evaluateWins(board: Reels): this;
|
|
1280
|
+
private getNeighbors;
|
|
1281
|
+
private evaluateCluster;
|
|
1282
|
+
private isChecked;
|
|
1283
|
+
private isCheckedWild;
|
|
1284
|
+
}
|
|
1285
|
+
interface ClusterWinTypeOpts extends WinTypeOpts {
|
|
1286
|
+
}
|
|
1287
|
+
interface ClusterWinCombination extends WinCombination {
|
|
1258
1288
|
}
|
|
1259
1289
|
|
|
1260
1290
|
declare class ManywaysWinType extends WinType {
|
|
1291
|
+
protected winCombinations: ManywaysWinCombination[];
|
|
1292
|
+
getWins: () => {
|
|
1293
|
+
payout: number;
|
|
1294
|
+
winCombinations: ManywaysWinCombination[];
|
|
1295
|
+
};
|
|
1296
|
+
private _checked;
|
|
1297
|
+
private _checkedWilds;
|
|
1298
|
+
constructor(opts: ManywaysWinTypeOpts);
|
|
1299
|
+
private validateConfig;
|
|
1300
|
+
/**
|
|
1301
|
+
* Calculates wins based on the defined paylines and provided board state.\
|
|
1302
|
+
* Retrieve the results using `getWins()` after.
|
|
1303
|
+
*/
|
|
1304
|
+
evaluateWins(board: Reels): this;
|
|
1305
|
+
private getWayLength;
|
|
1306
|
+
private isChecked;
|
|
1307
|
+
private isCheckedWild;
|
|
1308
|
+
}
|
|
1309
|
+
interface ManywaysWinTypeOpts extends WinTypeOpts {
|
|
1310
|
+
}
|
|
1311
|
+
interface ManywaysWinCombination extends WinCombination {
|
|
1312
|
+
ways: number;
|
|
1261
1313
|
}
|
|
1262
1314
|
|
|
1263
1315
|
/**
|
|
@@ -1431,6 +1483,14 @@ declare class StandaloneBoard {
|
|
|
1431
1483
|
getBoardReels(): Reels;
|
|
1432
1484
|
getPaddingTop(): Reels;
|
|
1433
1485
|
getPaddingBottom(): Reels;
|
|
1486
|
+
/**
|
|
1487
|
+
* Gets the symbol at the specified reel and row index.
|
|
1488
|
+
*/
|
|
1489
|
+
getSymbol(reelIndex: number, rowIndex: number): GameSymbol | undefined;
|
|
1490
|
+
/**
|
|
1491
|
+
* Sets the symbol at the specified reel and row index.
|
|
1492
|
+
*/
|
|
1493
|
+
setSymbol(reelIndex: number, rowIndex: number, symbol: GameSymbol): void;
|
|
1434
1494
|
private resetReels;
|
|
1435
1495
|
/**
|
|
1436
1496
|
* Sets the anticipation value for a specific reel.
|
package/dist/index.d.ts
CHANGED
|
@@ -328,6 +328,10 @@ declare class GameSymbol {
|
|
|
328
328
|
* Compares this symbol to another symbol or a set of properties.
|
|
329
329
|
*/
|
|
330
330
|
compare(symbolOrProperties?: GameSymbol | Record<string, any>): boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Creates a clone of this GameSymbol.
|
|
333
|
+
*/
|
|
334
|
+
clone(): GameSymbol;
|
|
331
335
|
}
|
|
332
336
|
interface GameSymbolOpts {
|
|
333
337
|
/**
|
|
@@ -370,6 +374,14 @@ declare class BoardService<TGameModes extends AnyGameModes = AnyGameModes, TSymb
|
|
|
370
374
|
getPaddingTop(): Reels;
|
|
371
375
|
getPaddingBottom(): Reels;
|
|
372
376
|
getAnticipation(): boolean[];
|
|
377
|
+
/**
|
|
378
|
+
* Gets the symbol at the specified reel and row index.
|
|
379
|
+
*/
|
|
380
|
+
getSymbol(reelIndex: number, rowIndex: number): GameSymbol | undefined;
|
|
381
|
+
/**
|
|
382
|
+
* Sets the symbol at the specified reel and row index.
|
|
383
|
+
*/
|
|
384
|
+
setSymbol(reelIndex: number, rowIndex: number, symbol: GameSymbol): void;
|
|
373
385
|
private resetReels;
|
|
374
386
|
/**
|
|
375
387
|
* Sets the anticipation value for a specific reel.
|
|
@@ -1171,6 +1183,7 @@ declare class WinType {
|
|
|
1171
1183
|
winCombinations: WinCombination[];
|
|
1172
1184
|
};
|
|
1173
1185
|
protected isWild(symbol: GameSymbol): boolean;
|
|
1186
|
+
protected getSymbolPayout(symbol: GameSymbol, count: number): number;
|
|
1174
1187
|
}
|
|
1175
1188
|
interface WinTypeOpts {
|
|
1176
1189
|
/**
|
|
@@ -1198,6 +1211,7 @@ interface WinTypeOpts {
|
|
|
1198
1211
|
type WinCombination = {
|
|
1199
1212
|
payout: number;
|
|
1200
1213
|
kind: number;
|
|
1214
|
+
baseSymbol: GameSymbol;
|
|
1201
1215
|
symbols: Array<{
|
|
1202
1216
|
symbol: GameSymbol;
|
|
1203
1217
|
isWild: boolean;
|
|
@@ -1226,6 +1240,7 @@ declare class LinesWinType extends WinType {
|
|
|
1226
1240
|
* Retrieve the results using `getWins()` after.
|
|
1227
1241
|
*/
|
|
1228
1242
|
evaluateWins(board: Reels): this;
|
|
1243
|
+
private getLinePayout;
|
|
1229
1244
|
}
|
|
1230
1245
|
interface LinesWinTypeOpts extends WinTypeOpts {
|
|
1231
1246
|
/**
|
|
@@ -1244,20 +1259,57 @@ interface LinesWinTypeOpts extends WinTypeOpts {
|
|
|
1244
1259
|
}
|
|
1245
1260
|
interface LineWinCombination extends WinCombination {
|
|
1246
1261
|
lineNumber: number;
|
|
1247
|
-
symbol: GameSymbol;
|
|
1248
|
-
winType: "pure-wild" | "substituted";
|
|
1249
|
-
substitutedBaseSymbol: GameSymbol | null;
|
|
1250
|
-
stats: {
|
|
1251
|
-
wildCount: number;
|
|
1252
|
-
nonWildCount: number;
|
|
1253
|
-
leadingWilds: number;
|
|
1254
|
-
};
|
|
1255
1262
|
}
|
|
1256
1263
|
|
|
1257
1264
|
declare class ClusterWinType extends WinType {
|
|
1265
|
+
protected winCombinations: ClusterWinCombination[];
|
|
1266
|
+
getWins: () => {
|
|
1267
|
+
payout: number;
|
|
1268
|
+
winCombinations: ClusterWinCombination[];
|
|
1269
|
+
};
|
|
1270
|
+
private _checked;
|
|
1271
|
+
private _checkedWilds;
|
|
1272
|
+
private _currentBoard;
|
|
1273
|
+
constructor(opts: ClusterWinTypeOpts);
|
|
1274
|
+
private validateConfig;
|
|
1275
|
+
/**
|
|
1276
|
+
* Calculates wins based on symbol cluster size and provided board state.\
|
|
1277
|
+
* Retrieve the results using `getWins()` after.
|
|
1278
|
+
*/
|
|
1279
|
+
evaluateWins(board: Reels): this;
|
|
1280
|
+
private getNeighbors;
|
|
1281
|
+
private evaluateCluster;
|
|
1282
|
+
private isChecked;
|
|
1283
|
+
private isCheckedWild;
|
|
1284
|
+
}
|
|
1285
|
+
interface ClusterWinTypeOpts extends WinTypeOpts {
|
|
1286
|
+
}
|
|
1287
|
+
interface ClusterWinCombination extends WinCombination {
|
|
1258
1288
|
}
|
|
1259
1289
|
|
|
1260
1290
|
declare class ManywaysWinType extends WinType {
|
|
1291
|
+
protected winCombinations: ManywaysWinCombination[];
|
|
1292
|
+
getWins: () => {
|
|
1293
|
+
payout: number;
|
|
1294
|
+
winCombinations: ManywaysWinCombination[];
|
|
1295
|
+
};
|
|
1296
|
+
private _checked;
|
|
1297
|
+
private _checkedWilds;
|
|
1298
|
+
constructor(opts: ManywaysWinTypeOpts);
|
|
1299
|
+
private validateConfig;
|
|
1300
|
+
/**
|
|
1301
|
+
* Calculates wins based on the defined paylines and provided board state.\
|
|
1302
|
+
* Retrieve the results using `getWins()` after.
|
|
1303
|
+
*/
|
|
1304
|
+
evaluateWins(board: Reels): this;
|
|
1305
|
+
private getWayLength;
|
|
1306
|
+
private isChecked;
|
|
1307
|
+
private isCheckedWild;
|
|
1308
|
+
}
|
|
1309
|
+
interface ManywaysWinTypeOpts extends WinTypeOpts {
|
|
1310
|
+
}
|
|
1311
|
+
interface ManywaysWinCombination extends WinCombination {
|
|
1312
|
+
ways: number;
|
|
1261
1313
|
}
|
|
1262
1314
|
|
|
1263
1315
|
/**
|
|
@@ -1431,6 +1483,14 @@ declare class StandaloneBoard {
|
|
|
1431
1483
|
getBoardReels(): Reels;
|
|
1432
1484
|
getPaddingTop(): Reels;
|
|
1433
1485
|
getPaddingBottom(): Reels;
|
|
1486
|
+
/**
|
|
1487
|
+
* Gets the symbol at the specified reel and row index.
|
|
1488
|
+
*/
|
|
1489
|
+
getSymbol(reelIndex: number, rowIndex: number): GameSymbol | undefined;
|
|
1490
|
+
/**
|
|
1491
|
+
* Sets the symbol at the specified reel and row index.
|
|
1492
|
+
*/
|
|
1493
|
+
setSymbol(reelIndex: number, rowIndex: number, symbol: GameSymbol): void;
|
|
1434
1494
|
private resetReels;
|
|
1435
1495
|
/**
|
|
1436
1496
|
* Sets the anticipation value for a specific reel.
|