From 9666676766bf21364f4fc4d0d1d336e72f2a91b4 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 6 Oct 2026 12:57:23 -0400 Subject: refactor: split casino.go, dedup helpers, remove audit docs --- internal/game/casino_ux.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'internal/game/casino_ux.go') diff --git a/internal/game/casino_ux.go b/internal/game/casino_ux.go index e2b74db..88562cd 100644 --- a/internal/game/casino_ux.go +++ b/internal/game/casino_ux.go @@ -115,8 +115,8 @@ func (g *Game) showCasinoChoices(sess *net.Session, choices []casinoChoice) { // renderCasinoFelt draws a table's felt (layout, payouts, board) without the // prose rule text. The table command shows this; rules opens the help page. -// Craps and roulette already render their felt through the live status -// snapshot, so they return nothing here. +// Games that draw their felt through Board() (craps, roulette, Big Six, +// Plinko, Cash Hunt, video poker) return nothing here. func (g *Game) renderCasinoFelt(sess *net.Session, cfg casino.TableConfig) string { switch cfg.Game { case casino.GameBlackjack: @@ -143,13 +143,22 @@ func (g *Game) executeTableStatus(sess *net.Session, args []string, _ string) { topic = "slots" } g.doHelp(sess, topic) - } else { - g.showCasinoChoices(sess, g.casinoChoices(sess.Player.RoomID)) + return + } + // A machine player has no table (Participation returns nil for + // machines), but bare table/status must still describe the machine they + // occupy instead of the room's "choose a game" list. + if playing { + if machine, ok := g.Casino.MachineFor(sess.Player.Name); ok { + sess.WriteLine(g.renderCasinoCommands(sess, g.casinoBalance(sess), machine.Config.ID, machine.Hints())) + return + } } + g.showCasinoChoices(sess, g.casinoChoices(sess.Player.RoomID)) return } - // table help remains a shortcut to the seated game's help page; the old - // "table rules" subcommand is gone, so bare table always shows the felt. + // Only "help" is special-cased here; any other argument is ignored and the + // table/status command falls through to the felt below. if len(args) > 0 && args[0] == "help" { g.doHelp(sess, t.HelpTopic()) if t.Config.Game != casino.GameVideoPoker { -- cgit v1.2.3