diff options
Diffstat (limited to 'src/client/tui.rs')
| -rw-r--r-- | src/client/tui.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client/tui.rs b/src/client/tui.rs index 9a4e4da..ddea5e2 100644 --- a/src/client/tui.rs +++ b/src/client/tui.rs | |||
| @@ -3,16 +3,19 @@ | |||
| 3 | //! This is the TUI's half of the `View` boundary: the GUI renders the same | 3 | //! This is the TUI's half of the `View` boundary: the GUI renders the same |
| 4 | //! data with a painter instead of strings. | 4 | //! data with a painter instead of strings. |
| 5 | 5 | ||
| 6 | use crate::client::games::blackjack::BlackjackGame; | ||
| 7 | use crate::client::games::crash::CrashGame; | ||
| 6 | use crate::client::games::roulette::RouletteGame; | 8 | use crate::client::games::roulette::RouletteGame; |
| 9 | use crate::client::games::slots::SlotsGame; | ||
| 7 | use crate::client::view::View; | 10 | use crate::client::view::View; |
| 8 | 11 | ||
| 9 | /// Render any view to terminal lines. | 12 | /// Render any view to terminal lines. |
| 10 | pub fn render_view(view: &View) -> Vec<String> { | 13 | pub fn render_view(view: &View) -> Vec<String> { |
| 11 | match view { | 14 | let rendered = match view { |
| 12 | View::Roulette(roulette) => RouletteGame::render_view(roulette) | 15 | View::Slots(slots) => SlotsGame::render_view(slots), |
| 13 | .lines() | 16 | View::Roulette(roulette) => RouletteGame::render_view(roulette), |
| 14 | .map(str::to_string) | 17 | View::Blackjack(blackjack) => BlackjackGame::render_view(blackjack), |
| 15 | .collect(), | 18 | View::Crash(crash) => CrashGame::render_view(crash), |
| 16 | View::Text(lines) => lines.clone(), | 19 | }; |
| 17 | } | 20 | rendered.lines().map(str::to_string).collect() |
| 18 | } | 21 | } |
