diff options
| author | historia <[not public]> | 2026-09-24 19:31:05 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-24 19:31:05 -0400 |
| commit | d114c747a7672c7e4daab3a5b5f1b2f066ebc912 (patch) | |
| tree | 81cc03354561f2f631d68f0de28bc742b1f49114 /internal/casino/config_validate.go | |
| parent | f606db40c3290fd9ce40b53ef9bbe135b1e6f6e2 (diff) | |
| download | thehouseoficarus-d114c747a7672c7e4daab3a5b5f1b2f066ebc912.tar.gz | |
feat: additional baca and bj rules variants
Diffstat (limited to 'internal/casino/config_validate.go')
| -rw-r--r-- | internal/casino/config_validate.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/internal/casino/config_validate.go b/internal/casino/config_validate.go index 9ad1776..a35f039 100644 --- a/internal/casino/config_validate.go +++ b/internal/casino/config_validate.go @@ -128,8 +128,17 @@ func validateBaccaratTable(c TableConfig) error { if b.TiePayout > maxTiePayout { return fmt.Errorf("tie_payout %v exceeds the %d:1 cap", b.TiePayout, maxTiePayout) } - if b.BankerPayout > maxBankerPayout { - return fmt.Errorf("banker_payout %v exceeds the %v:1 cap", b.BankerPayout, maxBankerPayout) + switch b.Variant { + case "", BaccaratCommission: + if b.BankerPayout > maxBankerPayout { + return fmt.Errorf("banker_payout %v exceeds the %v:1 cap", b.BankerPayout, maxBankerPayout) + } + case BaccaratSuper6, BaccaratEZ: + if b.BankerPayout != 0 && b.BankerPayout != 1 { + return fmt.Errorf("%s requires banker_payout: 1 (or omit it)", b.Variant) + } + default: + return fmt.Errorf("unsupported baccarat variant %q", b.Variant) } // Non-blocking for the same reason as blackjack above. return nil @@ -168,7 +177,8 @@ func hasBlackjackRuleBlock(c TableConfig) bool { func hasBaccaratRuleBlock(c TableConfig) bool { b := c.Baccarat - return b.Decks != 0 || b.ShuffleAt != 0 || b.TiePayout != 0 || b.BankerPayout != 0 + return b.Decks != 0 || b.ShuffleAt != 0 || b.TiePayout != 0 || b.BankerPayout != 0 || + b.Variant != "" || b.PairBets || b.Dragon7 || b.Panda8 || b.Super6Bet } func validateShoe(decks int, shuffleAt float64) error { |
