aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/types.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 18:38:35 -0400
committerhistoria <[not public]>2026-09-18 18:38:35 -0400
commit1f118d79e319da4e765502e9ca5b661772de94f1 (patch)
treebca8a3fd1e538f1c302480511e6ba872c92e10b8 /internal/casino/types.go
parent5ad42a51df4dcc5ccc3aa6a6d902085ce2ee4239 (diff)
downloadthehouseoficarus-1f118d79e319da4e765502e9ca5b661772de94f1.tar.gz
refactor: casino table core; fix: stake/migration/validation gaps
Diffstat (limited to 'internal/casino/types.go')
-rw-r--r--internal/casino/types.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/casino/types.go b/internal/casino/types.go
index 578aee1..3d31820 100644
--- a/internal/casino/types.go
+++ b/internal/casino/types.go
@@ -129,6 +129,13 @@ type MachineConfig struct {
Payout float64 `yaml:"payout,omitempty"`
}
+// LegacySlotMachine converts a legacy slots TableConfig (older rooms declared
+// slots under casino_tables) into the MachineConfig the room actually
+// instantiates. Shared by validation and room lookup so the two cannot drift.
+func LegacySlotMachine(c TableConfig) MachineConfig {
+ return MachineConfig{ID: c.ID, Game: GameSlots, MinBet: c.MinBet, MaxBet: c.MaxBet}
+}
+
func (c MachineConfig) Normalize() MachineConfig {
if c.MinBet <= 0 {
c.MinBet = 1