From 46202ee2e398ffd49febe6684f5c6a8648da600d Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 1 Nov 2026 17:58:03 +0100 Subject: v4.0.1: introduce Command/View and port roulette to the shared boundary --- src/client/tui.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/client/tui.rs (limited to 'src/client/tui.rs') diff --git a/src/client/tui.rs b/src/client/tui.rs new file mode 100644 index 0000000..9a4e4da --- /dev/null +++ b/src/client/tui.rs @@ -0,0 +1,18 @@ +//! Text rendering for the terminal adapter. +//! +//! This is the TUI's half of the `View` boundary: the GUI renders the same +//! data with a painter instead of strings. + +use crate::client::games::roulette::RouletteGame; +use crate::client::view::View; + +/// Render any view to terminal lines. +pub fn render_view(view: &View) -> Vec { + match view { + View::Roulette(roulette) => RouletteGame::render_view(roulette) + .lines() + .map(str::to_string) + .collect(), + View::Text(lines) => lines.clone(), + } +} -- cgit v1.2.3