From cc33072eced3d5460512c09c42ec4531c807d7af Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 19 Sep 2026 01:55:34 -0400 Subject: fix: casino stake preservation, world state reconciliation, casino game registration --- internal/casino/table.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'internal/casino/table.go') diff --git a/internal/casino/table.go b/internal/casino/table.go index e3104ae..408e5fe 100644 --- a/internal/casino/table.go +++ b/internal/casino/table.go @@ -72,13 +72,12 @@ type Table struct { // multiplayer table implementation. func newTable(roomID int, cfg TableConfig, rng *rand.Rand) *Table { cfg = cfg.Normalize() - var game tableGame - switch cfg.Game { - case GameBlackjack: - game = newBlackjackTable(roomID, cfg, rng) - case GameBaccarat: - game = newBaccaratTable(roomID, cfg, rng) - default: + def, ok := tableGameDefFor(cfg.Game) + if !ok { + return nil + } + game := def.new(roomID, cfg, rng) + if game == nil { return nil } // The Table and the game share the game's base, so RoomID/Config are a -- cgit v1.2.3