aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/types.go
diff options
context:
space:
mode:
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