From 1f118d79e319da4e765502e9ca5b661772de94f1 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 18:38:35 -0400 Subject: refactor: casino table core; fix: stake/migration/validation gaps --- internal/casino/types.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/casino/types.go') 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 -- cgit v1.2.3