@slot-engine/core 0.0.1 → 0.0.2

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 (42) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.mts +0 -7
  3. package/dist/index.d.ts +0 -7
  4. package/dist/index.js +9 -7
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +9 -7
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +5 -1
  9. package/.turbo/turbo-build.log +0 -33
  10. package/.turbo/turbo-typecheck.log +0 -4
  11. package/CHANGELOG.md +0 -7
  12. package/index.ts +0 -205
  13. package/lib/zstd.exe +0 -0
  14. package/optimizer-rust/Cargo.toml +0 -19
  15. package/optimizer-rust/src/exes.rs +0 -154
  16. package/optimizer-rust/src/main.rs +0 -1659
  17. package/src/Board.ts +0 -527
  18. package/src/Book.ts +0 -83
  19. package/src/GameConfig.ts +0 -148
  20. package/src/GameMode.ts +0 -86
  21. package/src/GameState.ts +0 -272
  22. package/src/GameSymbol.ts +0 -61
  23. package/src/ReelGenerator.ts +0 -589
  24. package/src/ResultSet.ts +0 -207
  25. package/src/Simulation.ts +0 -625
  26. package/src/SlotGame.ts +0 -117
  27. package/src/Wallet.ts +0 -203
  28. package/src/WinType.ts +0 -102
  29. package/src/analysis/index.ts +0 -198
  30. package/src/analysis/utils.ts +0 -128
  31. package/src/optimizer/OptimizationConditions.ts +0 -99
  32. package/src/optimizer/OptimizationParameters.ts +0 -46
  33. package/src/optimizer/OptimizationScaling.ts +0 -18
  34. package/src/optimizer/index.ts +0 -142
  35. package/src/utils/math-config.ts +0 -109
  36. package/src/utils/setup-file.ts +0 -36
  37. package/src/utils/zstd.ts +0 -28
  38. package/src/winTypes/ClusterWinType.ts +0 -3
  39. package/src/winTypes/LinesWinType.ts +0 -208
  40. package/src/winTypes/ManywaysWinType.ts +0 -3
  41. package/tsconfig.json +0 -19
  42. package/utils.ts +0 -270
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
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 during beta.
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
3
 
4
4
  # Slot Engine Core
5
5
 
package/dist/index.d.mts CHANGED
@@ -878,7 +878,6 @@ declare class GameConfig<TGameModes extends AnyGameModes = AnyGameModes, TSymbol
878
878
  readonly config: {
879
879
  readonly id: string;
880
880
  readonly name: string;
881
- readonly providerNumber: number;
882
881
  readonly gameModes: Record<GameModeName, GameMode>;
883
882
  readonly symbols: Map<TSymbols[number]["id"], TSymbols[number]>;
884
883
  readonly padSymbols?: number;
@@ -1159,7 +1158,6 @@ declare class SlotGame<TGameModes extends AnyGameModes = AnyGameModes, TSymbols
1159
1158
  */
1160
1159
  private runAnalysis;
1161
1160
  runTasks(opts?: {
1162
- debug?: boolean;
1163
1161
  doSimulation?: boolean;
1164
1162
  doOptimization?: boolean;
1165
1163
  doAnalysis?: boolean;
@@ -1185,10 +1183,6 @@ interface CommonGameOptions<TGameModes extends AnyGameModes = AnyGameModes, TSym
1185
1183
  * The name of the game, used for display purposes.
1186
1184
  */
1187
1185
  name: string;
1188
- /**
1189
- * An arbitrary number to identify the provider of this game.
1190
- */
1191
- providerNumber: number;
1192
1186
  /**
1193
1187
  * A GameMode is the core structure of a slot, defining the board,\
1194
1188
  * bet cost, win type, and other properties.
@@ -1288,7 +1282,6 @@ type InferGameType<TGameModes extends AnyGameModes, TSymbols extends AnySymbols,
1288
1282
  interface CreateSlotGameOpts<TGameModes extends AnyGameModes = AnyGameModes, TSymbols extends AnySymbols = AnySymbols, TUserState extends AnyUserData = AnyUserData> {
1289
1283
  id: CommonGameOptions["id"];
1290
1284
  name: CommonGameOptions["name"];
1291
- providerNumber: CommonGameOptions["providerNumber"];
1292
1285
  gameModes: TGameModes;
1293
1286
  symbols: TSymbols;
1294
1287
  scatterToFreespins: CommonGameOptions["scatterToFreespins"];
package/dist/index.d.ts CHANGED
@@ -878,7 +878,6 @@ declare class GameConfig<TGameModes extends AnyGameModes = AnyGameModes, TSymbol
878
878
  readonly config: {
879
879
  readonly id: string;
880
880
  readonly name: string;
881
- readonly providerNumber: number;
882
881
  readonly gameModes: Record<GameModeName, GameMode>;
883
882
  readonly symbols: Map<TSymbols[number]["id"], TSymbols[number]>;
884
883
  readonly padSymbols?: number;
@@ -1159,7 +1158,6 @@ declare class SlotGame<TGameModes extends AnyGameModes = AnyGameModes, TSymbols
1159
1158
  */
1160
1159
  private runAnalysis;
1161
1160
  runTasks(opts?: {
1162
- debug?: boolean;
1163
1161
  doSimulation?: boolean;
1164
1162
  doOptimization?: boolean;
1165
1163
  doAnalysis?: boolean;
@@ -1185,10 +1183,6 @@ interface CommonGameOptions<TGameModes extends AnyGameModes = AnyGameModes, TSym
1185
1183
  * The name of the game, used for display purposes.
1186
1184
  */
1187
1185
  name: string;
1188
- /**
1189
- * An arbitrary number to identify the provider of this game.
1190
- */
1191
- providerNumber: number;
1192
1186
  /**
1193
1187
  * A GameMode is the core structure of a slot, defining the board,\
1194
1188
  * bet cost, win type, and other properties.
@@ -1288,7 +1282,6 @@ type InferGameType<TGameModes extends AnyGameModes, TSymbols extends AnySymbols,
1288
1282
  interface CreateSlotGameOpts<TGameModes extends AnyGameModes = AnyGameModes, TSymbols extends AnySymbols = AnySymbols, TUserState extends AnyUserData = AnyUserData> {
1289
1283
  id: CommonGameOptions["id"];
1290
1284
  name: CommonGameOptions["name"];
1291
- providerNumber: CommonGameOptions["providerNumber"];
1292
1285
  gameModes: TGameModes;
1293
1286
  symbols: TSymbols;
1294
1287
  scatterToFreespins: CommonGameOptions["scatterToFreespins"];
package/dist/index.js CHANGED
@@ -59,7 +59,6 @@ var GameConfig = class _GameConfig {
59
59
  this.config = {
60
60
  id: opts.id,
61
61
  name: opts.name,
62
- providerNumber: opts.providerNumber,
63
62
  gameModes: opts.gameModes,
64
63
  symbols: /* @__PURE__ */ new Map(),
65
64
  padSymbols: opts.padSymbols || 0,
@@ -2162,14 +2161,17 @@ Simulating game mode: ${mode}`);
2162
2161
  * `weight` defaults to 1.
2163
2162
  */
2164
2163
  static writeLookupTableCSV(opts) {
2165
- const { gameMode, fileNameWithoutExtension, library, gameConfig } = opts;
2164
+ const { gameMode, library, gameConfig } = opts;
2166
2165
  const rows = [];
2167
2166
  for (const [bookId, book] of library.entries()) {
2168
2167
  rows.push(`${book.id},1,${Math.round(book.getPayout())}`);
2169
2168
  }
2170
2169
  rows.sort((a, b) => Number(a.split(",")[0]) - Number(b.split(",")[0]));
2171
- const outputFileName = fileNameWithoutExtension ? `${fileNameWithoutExtension}.csv` : `lookUpTable_${gameMode}.csv`;
2172
- const outputFilePath = import_path3.default.join(gameConfig.outputDir, outputFileName);
2170
+ let outputFileName = `lookUpTable_${gameMode}.csv`;
2171
+ let outputFilePath = import_path3.default.join(gameConfig.outputDir, outputFileName);
2172
+ writeFile(outputFilePath, rows.join("\n"));
2173
+ outputFileName = `lookUpTable_${gameMode}_0.csv`;
2174
+ outputFilePath = import_path3.default.join(gameConfig.outputDir, outputFileName);
2173
2175
  writeFile(outputFilePath, rows.join("\n"));
2174
2176
  return outputFilePath;
2175
2177
  }
@@ -2177,7 +2179,7 @@ Simulating game mode: ${mode}`);
2177
2179
  * Creates a CSV file in the format "simulationId,criteria,payoutBase,payoutFreespins".
2178
2180
  */
2179
2181
  static writeLookupTableSegmentedCSV(opts) {
2180
- const { gameMode, fileNameWithoutExtension, library, gameConfig } = opts;
2182
+ const { gameMode, library, gameConfig } = opts;
2181
2183
  const rows = [];
2182
2184
  for (const [bookId, book] of library.entries()) {
2183
2185
  rows.push(
@@ -2185,7 +2187,7 @@ Simulating game mode: ${mode}`);
2185
2187
  );
2186
2188
  }
2187
2189
  rows.sort((a, b) => Number(a.split(",")[0]) - Number(b.split(",")[0]));
2188
- const outputFileName = fileNameWithoutExtension ? `${fileNameWithoutExtension}.csv` : `lookUpTableSegmented_${gameMode}.csv`;
2190
+ const outputFileName = `lookUpTableSegmented_${gameMode}.csv`;
2189
2191
  const outputFilePath = import_path3.default.join(gameConfig.outputDir, outputFileName);
2190
2192
  writeFile(outputFilePath, rows.join("\n"));
2191
2193
  return outputFilePath;
@@ -2879,7 +2881,7 @@ var SlotGame = class {
2879
2881
  console.log("No tasks to run. Enable either simulation, optimization or analysis.");
2880
2882
  }
2881
2883
  if (opts.doSimulation) {
2882
- await this.runSimulation({ debug: opts.debug });
2884
+ await this.runSimulation(opts.simulationOpts || {});
2883
2885
  }
2884
2886
  if (opts.doOptimization) {
2885
2887
  await this.runOptimization(opts.optimizationOpts || { gameModes: [] });