aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/table_ux.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/casino/table_ux.go')
-rw-r--r--internal/casino/table_ux.go25
1 files changed, 18 insertions, 7 deletions
diff --git a/internal/casino/table_ux.go b/internal/casino/table_ux.go
index 4251e4f..569128b 100644
--- a/internal/casino/table_ux.go
+++ b/internal/casino/table_ux.go
@@ -283,15 +283,26 @@ func (t *blackjackTable) insuranceMenuLocked(p *blackjackPlayer) Event {
// the itemized line (empty for a lone anonymous hand); Result is the engine's
// settlement word ("win", "loss", "bust", "push", "blackjack",
// "surrender", "insurance").
-type settlementLine struct {
- Label string
- Result string
- Stake int
- Returned int
- Tag string // optional color-category override (jackpot, for example)
+type SettlementLine struct {
+ // Odds are profit odds, not total-return multipliers. Unresolved wagers
+ // retain their stake and are excluded from settlement totals.
+ Odds string
+ Unresolved bool
+ Label string
+ Result string
+ Stake int
+ Returned int
+ Tag string // optional color-category override (jackpot, for example)
}
-func (l settlementLine) net() int { return l.Returned - l.Stake }
+type settlementLine = SettlementLine
+
+func (l SettlementLine) net() int {
+ if l.Unresolved {
+ return 0
+ }
+ return l.Returned - l.Stake
+}
// resultTextLabel renders a settled wager as a colored outcome plus its net,
// naming the bet on its own line.