diff options
Diffstat (limited to 'internal/casino/table.go')
| -rw-r--r-- | internal/casino/table.go | 13 |
1 files changed, 6 insertions, 7 deletions
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 |
