From 80d9aa13251f7f5c3d3eeaa877bc79dac4435341 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 23:08:25 +0100 Subject: PLN changed to Kromer --- src/client/games/roulette.rs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/client/games/roulette.rs') diff --git a/src/client/games/roulette.rs b/src/client/games/roulette.rs index 3cb1c58..96f8791 100644 --- a/src/client/games/roulette.rs +++ b/src/client/games/roulette.rs @@ -1,5 +1,5 @@ use super::traits::{Game, GameState}; -use crate::roulette::{is_even, is_odd, BetTarget, Bets, Outside}; +use crate::roulette::{BetTarget, Bets, Outside, is_even, is_odd}; pub const ROULETTE_BOARD_LINES: usize = 12; @@ -96,7 +96,9 @@ impl Cursor { /// Numbers the cursor would cover, for highlighting the felt. pub fn numbers(&self) -> Vec { - self.target().map(|target| target.numbers()).unwrap_or_default() + self.target() + .map(|target| target.numbers()) + .unwrap_or_default() } pub fn moved(&self, direction: Direction) -> Cursor { @@ -130,9 +132,7 @@ impl Cursor { (Cursor::Column(index), Direction::Up) => Cursor::Dozen(index), (Cursor::Column(index), Direction::Down) => Cursor::Outside(index * 2), - (Cursor::Outside(index), Direction::Left) => { - Cursor::Outside(index.saturating_sub(1)) - } + (Cursor::Outside(index), Direction::Left) => Cursor::Outside(index.saturating_sub(1)), (Cursor::Outside(index), Direction::Right) => { Cursor::Outside((index + 1).min(OUTSIDE_ORDER.len() - 1)) } @@ -249,7 +249,11 @@ impl RouletteGame { .iter() .enumerate() .map(|(index, kind)| { - Self::wide_cell(kind.label(), OUTSIDE_WIDTH, cursor == Cursor::Outside(index)) + Self::wide_cell( + kind.label(), + OUTSIDE_WIDTH, + cursor == Cursor::Outside(index), + ) }) .collect() } @@ -268,7 +272,7 @@ impl RouletteGame { if list.chars().count() > 40 { list = list.chars().take(39).collect::() + "…"; } - format!("Bets: {list} Total: {} PLN", bets.total()) + format!("Bets: {list} Total: {} Kr", bets.total()) } fn status_line(state: &GameState) -> String { @@ -309,7 +313,7 @@ impl RouletteGame { format!("No win at {number} {color}{parity}") } else { let profit = winnings.parse::().unwrap_or(0).saturating_sub(stake); - format!("Won {winnings} PLN at {number} {color}{parity} (+{profit})") + format!("Won {winnings} Kr at {number} {color}{parity} (+{profit})") } } Some("spinning") => "Spinning...".to_string(), @@ -332,7 +336,7 @@ impl Game for RouletteGame { let lines = [ "=== ROULETTE ===".to_string(), - format!("Balance: {balance} PLN Chip: {chip} PLN"), + format!("Balance: {balance} Kr Chip: {chip} Kr"), Self::zero_cell(cursor), Self::number_row(0, &covered), Self::number_row(1, &covered), @@ -342,8 +346,7 @@ impl Game for RouletteGame { Self::outside_row(cursor), Self::bets_line(&bets), Self::status_line(state), - "[ARROWS] Move [ENTER] Bet [C]lear [+/-] Chip [SPACE] Spin [Q] Quit" - .to_string(), + "[ARROWS] Move [ENTER] Bet [C]lear [+/-] Chip [SPACE] Spin [Q] Quit".to_string(), ]; lines.join("\r\n") } -- cgit v1.2.3