diff options
Diffstat (limited to 'internal/casino/types.go')
| -rw-r--r-- | internal/casino/types.go | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/internal/casino/types.go b/internal/casino/types.go index 71da01c..578aee1 100644 --- a/internal/casino/types.go +++ b/internal/casino/types.go @@ -44,10 +44,20 @@ func ruleBool(value *bool, defaultValue bool) bool { func (c BlackjackConfig) DealerHitsSoft17() bool { return ruleBool(c.DealerHitSoft17, false) } func (c BlackjackConfig) AllowsResplitAces() bool { return ruleBool(c.ResplitAces, false) } func (c BlackjackConfig) AllowsDoubleAfterSplit() bool { return ruleBool(c.DoubleAfterSplit, true) } + +// CountsDoubleSplitBlackjack reports whether a 3+ card hand that reaches 21 +// after a split and double is paid as a blackjack (3:2). When true (the +// default) this raises the table RTP above the nominal blackjack payout; +// standard play pays 1:1 for any 21 on a split hand, doubled or not. func (c BlackjackConfig) CountsDoubleSplitBlackjack() bool { return ruleBool(c.DoubleSplitBlackjack, true) } -func (c BlackjackConfig) AllowsSurrender() bool { return ruleBool(c.Surrender, false) } + +func (c BlackjackConfig) AllowsSurrender() bool { return ruleBool(c.Surrender, false) } + +// AllowsUnlikeTenSplit reports whether any two 10-valued cards may split +// (K+Q, 10+J). Standard casinos split only identical ranks, so a true value +// (the default) is player-favourable. func (c BlackjackConfig) AllowsUnlikeTenSplit() bool { return ruleBool(c.SplitUnlikeTenValues, true) } func (c BlackjackConfig) Normalize() BlackjackConfig { @@ -159,14 +169,14 @@ func (c TableConfig) Normalize() TableConfig { if c.MaxBet <= 0 { c.MaxBet = DefaultMaxBet } - if c.MaxBet < c.MinBet { - c.MaxBet = c.MinBet - } // Normalize the nested game rule blocks too: a new game that reads // t.Config.Blackjack/Baccarat directly (rather than only t.Rules) would // otherwise see zero values and build an empty shoe. c.Blackjack = c.Blackjack.Normalize() c.Baccarat = c.Baccarat.Normalize() + if c.MaxBet < c.MinBet { + c.MaxBet = c.MinBet + } return c } |
