diff options
Diffstat (limited to 'internal/game/casino.go')
| -rw-r--r-- | internal/game/casino.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/game/casino.go b/internal/game/casino.go index 9f3b524..2e80bf3 100644 --- a/internal/game/casino.go +++ b/internal/game/casino.go @@ -47,6 +47,16 @@ func (w casinoWallet) PayCredits(amount int) { // then credits. func casinoAffordable(p *player.Player) int { return p.Credits + countChips(p) } +// inCasinoGame reports whether the player is currently seated at any casino +// table or machine. Nil-safe for test scaffolding without a Casino manager. +func (g *Game) inCasinoGame(name string) bool { + if g.Casino == nil { + return false + } + _, playing := g.Casino.Participation(name) + return playing +} + func (g *Game) casinoTable(roomID int, gameName string) (*casino.Table, bool) { room, err := g.World.LoadRoom(roomID) if err != nil { |
