Skip to main content

run_with_play

Function run_with_play 

Source
pub fn run_with_play<G, F>(game: G, play: F) -> ExitCode
Expand description

Like run, but the game supplies its own interactive play handler (a bespoke UI, say) rather than the built-in text stepper.

The headless new/query/act and self-play commands are handled here exactly as run does; only the interactive play command is delegated to play. This is how a game ships its own terminal UI (see examples/blackjack) without reimplementing the rest of the CLI.