diff options
| author | historia <[not public]> | 2026-10-01 15:47:17 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-01 15:47:17 -0400 |
| commit | c94728c929045f7c1bdf0166df152d944e5f99bc (patch) | |
| tree | 3d677caf166da36cd12ae200cc4c5d7a789d5c8f /internal/casino/pai_gow.go | |
| parent | 1082f3336085c15992ca83d5553c0ba52208d70a (diff) | |
| download | thehouseoficarus-c94728c929045f7c1bdf0166df152d944e5f99bc.tar.gz | |
feat: better casino game look output, more concise table instructions
Diffstat (limited to 'internal/casino/pai_gow.go')
| -rw-r--r-- | internal/casino/pai_gow.go | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/internal/casino/pai_gow.go b/internal/casino/pai_gow.go index 21abf4b..17d8971 100644 --- a/internal/casino/pai_gow.go +++ b/internal/casino/pai_gow.go @@ -70,7 +70,21 @@ func (t *paiGowTable) hasParticipant(name string) bool { func (t *paiGowTable) overview() string { t.mu.Lock() defer t.mu.Unlock() - return fmt.Sprintf("%s | %s | %d/%d seats", t.Config.Label(), t.phase, len(t.players), t.Config.MaxPlayers) + return fmt.Sprintf("%s | %d/%d seated", t.Config.Label(), len(t.players), t.Config.MaxPlayers) +} +func (t *paiGowTable) seats() []string { + t.mu.Lock() + defer t.mu.Unlock() + names := make([]string, 0, len(t.players)) + for _, p := range t.players { + names = append(names, p.name) + } + return names +} +func (t *paiGowTable) state() string { + t.mu.Lock() + defer t.mu.Unlock() + return t.phase } func (t *paiGowTable) hintsLocked(name string) []MenuCommand { p := t.player(name) @@ -145,7 +159,13 @@ func (t *paiGowTable) statusLocked(name string) []Event { } e := t.private(name, t.Config.Label()) e.Snapshot = s - e.Menu = &MenuView{Heading: t.Config.Label() + " | " + t.phase, ShowBalance: true, Commands: t.hintsLocked(name)} + // Context-aware hints are attached as a live menu; the shared board + // renderer places them below the felt. Stand-ins (for example a watcher) + // get no menu, so they cannot be told how to bet a game they have not joined. + if commands := t.hintsLocked(name); len(commands) > 0 { + e.Color = "casino_menu" + e.Menu = &MenuView{Heading: t.Config.Label() + " | " + t.phase, ShowBalance: true, Commands: commands} + } return []Event{e} } func (t *paiGowTable) status(name string) []Event { |
