aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/table.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-19 01:55:34 -0400
committerhistoria <[not public]>2026-09-19 01:55:34 -0400
commitcc33072eced3d5460512c09c42ec4531c807d7af (patch)
treeb1b451fa87fa389cb8343a3645372f3b43f5523e /internal/casino/table.go
parent2c38386484cdb507c4687caceb37e0b963e33594 (diff)
downloadthehouseoficarus-cc33072eced3d5460512c09c42ec4531c807d7af.tar.gz
fix: casino stake preservation, world state reconciliation, casino game registration
Diffstat (limited to 'internal/casino/table.go')
-rw-r--r--internal/casino/table.go13
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