aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/registry.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-02 01:54:37 -0400
committerhistoria <[not public]>2026-10-02 01:54:37 -0400
commitd3a305d1d7962f82af2397760cf8008758bddd1d (patch)
treef91f0deb342c20f2993e5366f772c3432648f426 /internal/casino/registry.go
parent8eea0e4e06a4aaa6a18edabd9897d3bea1ea2ca0 (diff)
downloadthehouseoficarus-d3a305d1d7962f82af2397760cf8008758bddd1d.tar.gz
feat: better 'list' bet table, multiple bets in baccarat
Diffstat (limited to 'internal/casino/registry.go')
-rw-r--r--internal/casino/registry.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/casino/registry.go b/internal/casino/registry.go
index 25fbce5..dbf3b31 100644
--- a/internal/casino/registry.go
+++ b/internal/casino/registry.go
@@ -13,6 +13,9 @@ import (
// apart. The rule structs stay on TableConfig; this does not introduce a
// config union.
type tableGameDef struct {
+ // houseEdge analyzes this game's own configured wagers; nil means unverified,
+ // never zero. See house_edge.go for the loss/stake convention.
+ houseEdge func(TableConfig, string) HouseEdge
// validate checks a raw (pre-Normalize) table config.
validate func(TableConfig) error
// normalize applies this game's rule defaults to a table config.
@@ -42,7 +45,8 @@ var tableGames map[GameName]tableGameDef
func init() {
tableGames = map[GameName]tableGameDef{
GamePaiGow: {
- validate: validatePaiGow,
+ houseEdge: paiGowHouseEdge,
+ validate: validatePaiGow,
normalize: func(c TableConfig) TableConfig {
c.PaiGow = c.PaiGow.Normalize()
c.MaxPlayers = min(c.MaxPlayers, 6)
@@ -56,6 +60,7 @@ func init() {
helpTopic: func(TableConfig) string { return "pai gow poker" },
},
GameVideoPoker: {
+ houseEdge: videoPokerHouseEdge,
validate: func(c TableConfig) error {
if c.MaxPlayers > 1 {
return fmt.Errorf("video poker cabinets have one seat")
@@ -70,6 +75,7 @@ func init() {
helpTopic: func(c TableConfig) string { return pokerHelpTopic(c.VideoPoker) },
},
GameCraps: {
+ houseEdge: crapsHouseEdge,
validate: validateCraps,
normalize: func(c TableConfig) TableConfig { c.Craps = c.Craps.Normalize(); return c },
ruleBlockName: "craps",
@@ -79,6 +85,7 @@ func init() {
helpTopic: func(c TableConfig) string { return c.Craps.helpTopic() },
},
GameRoulette: {
+ houseEdge: rouletteHouseEdge,
validate: func(c TableConfig) error {
if c.Roulette.SpinTicks < 0 || c.Roulette.SpinTicks > maxSpinTicks {
return fmt.Errorf("roulette spin_ticks must be between 0 and %d", maxSpinTicks)
@@ -101,6 +108,7 @@ func init() {
helpTopic: func(TableConfig) string { return "roulette" },
},
GameBlackjack: {
+ houseEdge: blackjackHouseEdge,
validate: validateBlackjackTable,
normalize: normalizeBlackjackTable,
ruleBlockName: "blackjack",
@@ -112,6 +120,7 @@ func init() {
helpTopic: func(TableConfig) string { return "blackjack" },
},
GameBaccarat: {
+ houseEdge: baccaratHouseEdge,
validate: validateBaccaratTable,
normalize: normalizeBaccaratTable,
ruleBlockName: "baccarat",