aboutsummaryrefslogtreecommitdiff
path: root/internal/game/render_video_poker.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-01 17:24:54 -0400
committerhistoria <[not public]>2026-10-01 17:24:54 -0400
commit4e2a95503e4ea4c830510f5aea23fac7948ddc41 (patch)
tree690b06df9094480febfaaaf7d9fc71ef7b81848d /internal/game/render_video_poker.go
parentd762f8e1360cf38b8e11e69083c2dad59ec7130e (diff)
downloadthehouseoficarus-4e2a95503e4ea4c830510f5aea23fac7948ddc41.tar.gz
feat: set and autoset in pai gow, better showdown arrangement, better formatting
Diffstat (limited to 'internal/game/render_video_poker.go')
-rw-r--r--internal/game/render_video_poker.go35
1 files changed, 6 insertions, 29 deletions
diff --git a/internal/game/render_video_poker.go b/internal/game/render_video_poker.go
index b8baef8..b8262c8 100644
--- a/internal/game/render_video_poker.go
+++ b/internal/game/render_video_poker.go
@@ -87,43 +87,20 @@ func renderPokerCards(cards []casino.CardView, held *[5]bool, mode string, unico
if len(cards) == 0 {
return nil
}
- art := make([][]string, len(cards))
- widths := make([]int, len(cards))
- height := 0
- for i, c := range cards {
- art[i] = cardsLine(mode, []casino.CardView{c}, size, unicode, style, store)
- height = max(height, len(art[i]))
- for _, line := range art[i] {
- widths[i] = max(widths[i], color.VisibleLen(line))
- }
- if held != nil {
- widths[i] = max(widths[i], 6)
- }
- }
- var lines []string
- for r := 0; r < height; r++ {
- parts := make([]string, len(cards))
- for i := range cards {
- text := ""
- if r < len(art[i]) {
- text = art[i][r]
- }
- parts[i] = rouletteCenter(text, widths[i])
- }
- lines = append(lines, strings.Join(parts, " "))
- }
+ var labels []string
+ minWidth := 0
if held != nil {
- labels := make([]string, len(cards))
+ labels = make([]string, len(cards))
+ minWidth = 6
for i := range cards {
text := fmt.Sprint(i + 1)
if held[i] {
text = color.Render(mode, color.ColorSpec{Fg: pokerYellow, Bg: -1, Bold: true}, text+" HELD")
}
- labels[i] = rouletteCenter(text, widths[i])
+ labels[i] = text
}
- lines = append(lines, strings.Join(labels, " "))
}
- return lines
+ return renderCardRow(cards, labels, minWidth, mode, unicode, size, style, store)
}
func renderVideoPoker(s *casino.VideoPokerSnapshot, mode string, unicode bool, size int, style string, store *cardart.Store) string {