aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino_ux.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-01 15:47:17 -0400
committerhistoria <[not public]>2026-10-01 15:47:17 -0400
commitc94728c929045f7c1bdf0166df152d944e5f99bc (patch)
tree3d677caf166da36cd12ae200cc4c5d7a789d5c8f /internal/game/casino_ux.go
parent1082f3336085c15992ca83d5553c0ba52208d70a (diff)
downloadthehouseoficarus-c94728c929045f7c1bdf0166df152d944e5f99bc.tar.gz
feat: better casino game look output, more concise table instructions
Diffstat (limited to 'internal/game/casino_ux.go')
-rw-r--r--internal/game/casino_ux.go25
1 files changed, 16 insertions, 9 deletions
diff --git a/internal/game/casino_ux.go b/internal/game/casino_ux.go
index 6f7964f..1d66f43 100644
--- a/internal/game/casino_ux.go
+++ b/internal/game/casino_ux.go
@@ -61,6 +61,21 @@ func resolveCasinoChoice(choices []casinoChoice, input string) (casinoChoice, bo
return casinoChoice{}, false
}
+// casinoTableAliases lists the names the play, list and look commands accept
+// for a multiplayer table, beyond its raw game name and fixture id.
+func casinoTableAliases(cfg casino.TableConfig) []string {
+ names := []string{string(cfg.Game)}
+ switch cfg.Game {
+ case casino.GameBlackjack:
+ names = append(names, "bj")
+ case casino.GameBaccarat:
+ names = append(names, "bac")
+ case casino.GamePaiGow:
+ names = append(names, "pai", "pai gow", "pai gow poker")
+ }
+ return names
+}
+
func (g *Game) casinoChoices(roomID int) []casinoChoice {
room, err := g.World.LoadRoom(roomID)
if err != nil {
@@ -73,15 +88,7 @@ func (g *Game) casinoChoices(roomID int) []casinoChoice {
choices = append(choices, casinoChoice{address: c.ID, names: names, table: true})
continue
}
- names := []string{string(c.Game)}
- switch c.Game {
- case casino.GameBlackjack:
- names = append(names, "bj")
- case casino.GameBaccarat:
- names = append(names, "bac")
- case casino.GamePaiGow:
- names = append(names, "paigow", "pai", "pai gow", "pai gow poker")
- }
+ names := casinoTableAliases(c)
choices = append(choices, casinoChoice{address: string(c.Game), names: names, table: true})
}
for _, c := range room.CasinoMachines {