/** * Spinza original game library. Each folder is one game: a declarative * definition consumed by the shared engine. `calibration.json` holds the RTP * tuning factor produced by `pnpm sim calibrate` — never edit pays of a * published game without bumping its version. */ import type { GameDefinition } from "@spinza/game-core"; import calibration from "./calibration.json"; import { RAW } from "./registry"; type Calibration = Record; function applyCalibration(def: GameDefinition): GameDefinition { const c = (calibration as Calibration)[def.slug]; if (c && c.version === def.version) return { ...def, payScale: c.payScale }; return def; } export const GAMES: GameDefinition[] = RAW.map(applyCalibration); export const GAMES_BY_SLUG: Map = new Map(GAMES.map((g) => [g.slug, g])); /** Uncalibrated definitions (payScale = 1) for the calibration tool. */ export const RAW_GAMES: GameDefinition[] = RAW; export function getGame(slug: string): GameDefinition | undefined { return GAMES_BY_SLUG.get(slug); } /** Order in which games are displayed by default (flagship first). */ export const FEATURED_ORDER = ["spinza-original", "neon-vault", "cosmic-collapse", "obsidian", "diamond-heist", "quantum-jackpot"]; export const FIRST_GAME_RECOMMENDATIONS = ["neon-vault", "cosmic-collapse", "spinza-original"]; export { RAW } from "./registry"; export { CRASH_GAMES, CRASH_BY_SLUG } from "./crash"; export { ARCADE_GAMES, ARCADE_BY_SLUG, RAW_ARCADE_GAMES } from "./arcade";