aboutsummaryrefslogtreecommitdiff
path: root/internal/casino
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-02 02:16:44 -0400
committerhistoria <[not public]>2026-10-02 02:16:44 -0400
commit62017c86392b046d746fb4fafef6742840477c5f (patch)
treeeab569e29e858ff79b8ce06caa9bacb28bc9ee81 /internal/casino
parentd3a305d1d7962f82af2397760cf8008758bddd1d (diff)
downloadthehouseoficarus-62017c86392b046d746fb4fafef6742840477c5f.tar.gz
feat: polish 'list' output, drop sitout command
Diffstat (limited to 'internal/casino')
-rw-r--r--internal/casino/baccarat.go2
-rw-r--r--internal/casino/blackjack.go2
-rw-r--r--internal/casino/craps.go7
-rw-r--r--internal/casino/craps_rules.go2
-rw-r--r--internal/casino/craps_variants.go4
-rw-r--r--internal/casino/roulette.go9
-rw-r--r--internal/casino/table.go13
-rw-r--r--internal/casino/table_hints.go7
-rw-r--r--internal/casino/table_ux.go1
-rw-r--r--internal/casino/video_poker.go13
10 files changed, 48 insertions, 12 deletions
diff --git a/internal/casino/baccarat.go b/internal/casino/baccarat.go
index e30de5b..c37870d 100644
--- a/internal/casino/baccarat.go
+++ b/internal/casino/baccarat.go
@@ -122,7 +122,7 @@ func (t *baccaratTable) menuEvent(name string) Event {
MenuCommand{Command: fmt.Sprintf("bet %d banker", t.Config.MinBet)},
MenuCommand{Command: "bet <amount> on <bet>"},
MenuCommand{Command: "stop", Desc: "Leave; during a round, leave afterward"},
- MenuCommand{Command: "table / sitout", Desc: "Check the table / skip betting until you rejoin"})
+ MenuCommand{Command: "table", Desc: "Check the table"})
commands = withTableHints(commands, t.wagerRows())
e := t.betMenuEvent(name, commands)
if p != nil {
diff --git a/internal/casino/blackjack.go b/internal/casino/blackjack.go
index a059bdb..eee5023 100644
--- a/internal/casino/blackjack.go
+++ b/internal/casino/blackjack.go
@@ -120,7 +120,7 @@ func (t *blackjackTable) menuEvent(name string) Event {
{Command: "bet", Desc: fmt.Sprintf("%s: %d credits (also: rebet)", desc, amount)},
{Command: "bet <amount>", Desc: "Change wager; min/max accepted"},
{Command: "stop", Desc: "Leave; during a round, leave afterward"},
- {Command: "table / sitout", Desc: "Check the table / skip betting until you rejoin"},
+ {Command: "table", Desc: "Check the table"},
})
// Blackjack has a single wager target, so no list hint; rules rides along.
e.Menu.Commands = withTableHints(e.Menu.Commands, nil)
diff --git a/internal/casino/craps.go b/internal/casino/craps.go
index 69a38ed..8322192 100644
--- a/internal/casino/craps.go
+++ b/internal/casino/craps.go
@@ -102,6 +102,13 @@ func (t *crapsTable) view() *CrapsSnapshot {
}
return s
}
+
+// board is the table-only view for the table command.
+func (t *crapsTable) board(_ string) Snapshot {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+ return t.view()
+}
func (t *crapsTable) menu(name string) Event {
e := t.betMenuEvent(name, t.commands(name))
e.Snapshot = t.view()
diff --git a/internal/casino/craps_rules.go b/internal/casino/craps_rules.go
index 6292b4a..88649a2 100644
--- a/internal/casino/craps_rules.go
+++ b/internal/casino/craps_rules.go
@@ -97,7 +97,7 @@ func (c TableConfig) CrapsRulesText() string {
"Bets remain open until the roll. Dice rotate on seven-out.\n"+
"autoroll: repeat every 3 seconds on your turn (multiplayer waits 10 seconds).\n"+
"unbet: remove every non-contract bet and all free odds; pass/come contracts stay.\n"+
- "stop cancels autoroll without leaving; in manual mode stop/sitout wait for bets.\n"+
+ "stop cancels autoroll without leaving; in manual mode stop waits for live bets.\n"+
"Disconnect forfeits live bets.\n"+
"Winning bets return stake and are removed (no automatic pressing).", odds, r.Field12)
}
diff --git a/internal/casino/craps_variants.go b/internal/casino/craps_variants.go
index dcaf1cd..096bfc5 100644
--- a/internal/casino/craps_variants.go
+++ b/internal/casino/craps_variants.go
@@ -221,12 +221,12 @@ func (c CrapsConfig) variantRulesText() string {
cadence := "Solo roll anytime; multiplayer waits 10 seconds, then dealer rolls after 60 seconds."
autoroll := "Bets stay open until the roll. autoroll repeats every 3 seconds, respecting the betting window."
betLine := "Bet: bet <amount> on pass; the felt is authoritative for this edition."
- stopLine := "stop cancels autoroll; manual stop/sitout waits for live bets."
+ stopLine := "stop cancels autoroll; manual stop waits for live bets."
if c.variant() == "simplified" {
betLine = "Bet: bet <amount> — always on pass; bare bet rebets your last wager."
cadence = "The dice roll automatically 3 seconds after the first bet."
autoroll = ""
- stopLine = "stop/sitout waits for live bets."
+ stopLine = "stop waits for live bets."
}
lines := []string{c.title() + " — house rules", rules, betLine,
fmt.Sprintf("Free odds: %d (0 = 3-4-5x on ordinary points, don't 6x laid). No odds on Simplified, High Point or Die Rich.", c.Odds),
diff --git a/internal/casino/roulette.go b/internal/casino/roulette.go
index 8949ff8..de6536f 100644
--- a/internal/casino/roulette.go
+++ b/internal/casino/roulette.go
@@ -502,6 +502,13 @@ func (t *rouletteTable) view() *RouletteSnapshot {
}
return s
}
+
+// board is the table-only view for the table command.
+func (t *rouletteTable) board(_ string) Snapshot {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+ return t.view()
+}
func (t *rouletteTable) menuEvent(name string) Event {
commands := []MenuCommand{}
p := t.players.get(name)
@@ -512,7 +519,7 @@ func (t *rouletteTable) menuEvent(name string) Event {
}
}
if p != nil {
- commands = append(commands, MenuCommand{Command: "sitout / stop", Desc: "Sit out / leave when your wager settles"})
+ commands = append(commands, MenuCommand{Command: "stop", Desc: "Leave when your wager settles"})
}
commands = append(commands, MenuCommand{Command: "table", Desc: "View the layout"})
if p != nil {
diff --git a/internal/casino/table.go b/internal/casino/table.go
index 2f4473b..08c18bf 100644
--- a/internal/casino/table.go
+++ b/internal/casino/table.go
@@ -129,7 +129,18 @@ func (t *Table) idle() bool { return t.game.idle() }
// Status is a read-only view: it never restarts a deadline or changes a wager.
func (t *Table) Status(name string) []Event { return t.game.status(name) }
-func (t *Table) Overview() string { return t.game.overview() }
+
+// Board returns the game's table-only board for the table command: the live
+// wheel, dice layout or paytable, with no balance, command menu, or state
+// prose. Games whose table is a printed felt return nil so the caller can
+// render the felt instead.
+func (t *Table) Board(name string) Snapshot {
+ if b, ok := t.game.(interface{ board(name string) Snapshot }); ok {
+ return b.board(name)
+ }
+ return nil
+}
+func (t *Table) Overview() string { return t.game.overview() }
// Seats lists the seated players in seat order for the look command.
func (t *Table) Seats() []string { return t.game.seats() }
diff --git a/internal/casino/table_hints.go b/internal/casino/table_hints.go
index 51dda1a..d44deb7 100644
--- a/internal/casino/table_hints.go
+++ b/internal/casino/table_hints.go
@@ -24,7 +24,7 @@ func (t *rouletteTable) hints(name string) []MenuCommand {
commands = append(commands, MenuCommand{Command: "bet / rebet", Desc: "Repeat your previous wager"})
}
}
- commands = append(commands, MenuCommand{Command: "sitout / stop", Desc: "Sit out / leave when your wager settles"})
+ commands = append(commands, MenuCommand{Command: "stop", Desc: "Leave when your wager settles"})
commands = append(commands, MenuCommand{Command: "table", Desc: "View the layout"})
return withTableHints(commands, t.wagerRows())
}
@@ -34,7 +34,6 @@ func (t *rouletteTable) hints(name string) []MenuCommand {
func blackjackHintsIdle() []MenuCommand {
return []MenuCommand{
{Command: "table", Desc: "View the table"},
- {Command: "sitout", Desc: "Sit out after this round"},
{Command: "stop", Desc: "Leave after this round"},
}
}
@@ -71,7 +70,7 @@ func baccaratHintCommands(t *baccaratTable, name string) []MenuCommand {
return []MenuCommand{
{Command: "unbet", Desc: "Take back all your wagers before the round"},
{Command: "stop", Desc: "Leave; during a round, leave afterward"},
- {Command: "table / sitout", Desc: "Check the table / skip betting until you rejoin"},
+ {Command: "table", Desc: "Check the table"},
}
}
commands := []MenuCommand{}
@@ -85,6 +84,6 @@ func baccaratHintCommands(t *baccaratTable, name string) []MenuCommand {
MenuCommand{Command: fmt.Sprintf("bet %d banker", t.Config.MinBet)},
MenuCommand{Command: "bet <amount> on <bet>"},
MenuCommand{Command: "stop", Desc: "Leave; during a round, leave afterward"},
- MenuCommand{Command: "table / sitout", Desc: "Check the table / skip betting until you rejoin"},
+ MenuCommand{Command: "table", Desc: "Check the table"},
)
}
diff --git a/internal/casino/table_ux.go b/internal/casino/table_ux.go
index c7b9fd1..d16d434 100644
--- a/internal/casino/table_ux.go
+++ b/internal/casino/table_ux.go
@@ -112,7 +112,6 @@ func (c *tableCore[P]) committedMenu(name string) Event {
e.Color = "casino_menu"
commands := []MenuCommand{
{Command: "table", Desc: "View the table"},
- {Command: "sitout", Desc: "Sit out after this round"},
{Command: "stop", Desc: "Leave after this round"},
}
// Until the round is dealt or spun, the committed wager can still be
diff --git a/internal/casino/video_poker.go b/internal/casino/video_poker.go
index a22d3c8..7e79b58 100644
--- a/internal/casino/video_poker.go
+++ b/internal/casino/video_poker.go
@@ -217,6 +217,19 @@ func (t *videoPokerTable) statusLocked(name string, showTable bool) []Event {
return []Event{e}
}
+// board is the table-only view for the table command: the paytable and game
+// state without the balance line or command menu.
+func (t *videoPokerTable) board(name string) Snapshot {
+ t.mu.Lock()
+ defer t.mu.Unlock()
+ for _, e := range t.statusLocked(name, true) {
+ if e.Snapshot != nil {
+ return e.Snapshot
+ }
+ }
+ return nil
+}
+
func (t *videoPokerTable) join(name string) []Event {
t.mu.Lock()
defer t.mu.Unlock()