aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/craps_clock.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/casino/craps_clock.go')
-rw-r--r--internal/casino/craps_clock.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/casino/craps_clock.go b/internal/casino/craps_clock.go
index 5357c93..30f56e5 100644
--- a/internal/casino/craps_clock.go
+++ b/internal/casino/craps_clock.go
@@ -27,6 +27,17 @@ func (t *crapsTable) shooter() *crapsPlayer {
}
return t.players.get(t.queue[0])
}
+
+// busy reports whether the named player's dice are still in the air. The
+// command loop uses it to hold the prompt until the roll resolves, so the
+// shake message is not split from its result by a stray prompt. Other players
+// may still bet (and be prompted) during the same window.
+func (t *crapsTable) busy(name string) bool {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+ s := t.shooter()
+ return t.pendingRollTicks > 0 && s != nil && s.Name == name
+}
func (t *crapsTable) hasLiveBets() bool {
for _, p := range t.players.ordered() {
if p.HasBet {