From ced77d7c89129da6ba4001ab8e3dad265aa41396 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 9 Oct 2026 17:05:54 -0400 Subject: feat: new casino game: coin flip --- internal/casino/table.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal/casino/table.go') diff --git a/internal/casino/table.go b/internal/casino/table.go index d9d3525..4ab4e3a 100644 --- a/internal/casino/table.go +++ b/internal/casino/table.go @@ -153,6 +153,20 @@ func (t *Table) Busy(name string) bool { return false } +// stakeMultiple is the optional interface for a game whose wallet debit is a +// multiple of the player's stated stake. Coin Flip reserves 100x so a -100 +// swing is fully covered; every other game debits the stake itself. +type stakeMultiple interface{ stakeMultiple() int } + +// StakeMultiple reports how many credits the game debits per unit of the +// player's stated stake. It sizes "bet max" and affordability previews. +func (t *Table) StakeMultiple() int { + if m, ok := t.game.(stakeMultiple); ok { + return m.stakeMultiple() + } + return 1 +} + // Seats lists the seated players in seat order for the look command. func (t *Table) Seats() []string { return t.game.seats() } -- cgit v1.2.3