aboutsummaryrefslogtreecommitdiff
path: root/internal/game/render_roulette.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-06 12:57:23 -0400
committerhistoria <[not public]>2026-10-06 12:57:23 -0400
commit9666676766bf21364f4fc4d0d1d336e72f2a91b4 (patch)
tree0cade34091d7602790dc38cd44053f0b74bbadf2 /internal/game/render_roulette.go
parent4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (diff)
downloadthehouseoficarus-9666676766bf21364f4fc4d0d1d336e72f2a91b4.tar.gz
refactor: split casino.go, dedup helpers, remove audit docs
Diffstat (limited to 'internal/game/render_roulette.go')
-rw-r--r--internal/game/render_roulette.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/game/render_roulette.go b/internal/game/render_roulette.go
index a0f1e04..89c14c6 100644
--- a/internal/game/render_roulette.go
+++ b/internal/game/render_roulette.go
@@ -134,7 +134,7 @@ func renderRouletteRacetrack(mode string, unicode bool) string {
pocket := func(x, y, index, width int) {
n := wheel[index%len(wheel)]
bg, name := roulettePocketColor(n)
- if mode == "none" || mode == "" {
+ if color.Plain(mode) {
n += name[:1]
}
put(x, y, rouletteCenter(n, width), bg)
@@ -318,7 +318,7 @@ func renderRouletteLayout(double, racetrack bool, mode string, unicode bool) str
case !double && row == 2:
zero = "0"
}
- if mode == "none" || mode == "" {
+ if color.Plain(mode) {
zero += "G"
}
// The 0/00 lane is one green rectangle, so its blank cells above and
@@ -327,7 +327,7 @@ func renderRouletteLayout(double, racetrack bool, mode string, unicode bool) str
for n := row; n <= 36; n += 3 {
pocket := strconv.Itoa(n)
bg, name := roulettePocketColor(pocket)
- if mode == "none" || mode == "" {
+ if color.Plain(mode) {
pocket += name[:1]
}
line += roulettePaint(mode, rouletteCenter(pocket, 4), bg) + rouletteInk(mode, b.v)
@@ -382,7 +382,7 @@ func renderRouletteLayout(double, racetrack bool, mode string, unicode bool) str
}
bottom += b.br
lines = append(lines, line, rouletteInk(mode, bottom))
- if mode == "none" || mode == "" {
+ if color.Plain(mode) {
lines = append(lines, "R = red, B = black, G = green")
}
return strings.Join(lines, "\n")
@@ -419,7 +419,7 @@ func renderRouletteWheel(wheel []string, mode string, unicode bool) string {
grid[y][x] = rouletteCell{' ', -1}
}
}
- plain := mode == "none" || mode == ""
+ plain := color.Plain(mode)
pocketRune := func(bg int) rune {
if !plain {
return ' '
@@ -553,7 +553,7 @@ func renderRouletteRow(row []rouletteCell, mode string) string {
j++
}
text := string(seg)
- if bg >= 0 && mode != "none" && mode != "" {
+ if bg >= 0 && !color.Plain(mode) {
sb.WriteString(roulettePaint(mode, text, bg))
} else {
sb.WriteString(rouletteInk(mode, text))
@@ -584,7 +584,7 @@ func renderRouletteResult(pockets [5]string, mode string, unicode bool, size int
ballRow := size / 2
hasRule := ballRow > ruleRow
colorRow := size - 2
- plain := mode == "none" || mode == ""
+ plain := color.Plain(mode)
var lines []string
for row := 0; row < size; row++ {
var cells []string