diff options
Diffstat (limited to 'internal/game/casino_ux.go')
| -rw-r--r-- | internal/game/casino_ux.go | 25 |
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 { |
