diff options
| author | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
| commit | 9666676766bf21364f4fc4d0d1d336e72f2a91b4 (patch) | |
| tree | 0cade34091d7602790dc38cd44053f0b74bbadf2 /internal/casino/types.go | |
| parent | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (diff) | |
| download | thehouseoficarus-9666676766bf21364f4fc4d0d1d336e72f2a91b4.tar.gz | |
refactor: split casino.go, dedup helpers, remove audit docs
Diffstat (limited to 'internal/casino/types.go')
| -rw-r--r-- | internal/casino/types.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/casino/types.go b/internal/casino/types.go index f6a828d..9a3f0a1 100644 --- a/internal/casino/types.go +++ b/internal/casino/types.go @@ -237,6 +237,11 @@ type Wallet interface { // refund could not be made durable: nothing was returned and the stakes // remain pending for a later attempt or startup recovery. RefundOutstanding() (chips, credits int, err error) + // RefundStakes returns the named pending stakes in kind — chips as chips, + // credits as credits — and removes them from the ledger in one save. It is + // the take-back path for a seat that holds specific handles; unlike + // PayCredits it never converts casino-only chips into spendable credits. + RefundStakes(stakeIDs ...string) error } type EventType string @@ -381,3 +386,11 @@ type Participant struct { SitOutAfter bool LeaveAfter bool } + +// SettlementBalanceNeeded reports whether a settlement should print the seat's +// balance: the seat is leaving, sitting out after the round, or disconnected, +// and the payout did not fail. Shared by every table so the rule lives in one +// place instead of being copy-pasted per game. +func (p *Participant) SettlementBalanceNeeded(payoutFailed bool) bool { + return !payoutFailed && (p.LeaveAfter || p.SitOutAfter || !p.Connected) +} |
