pub fn run_with_play<G, F>(game: G, play: F) -> ExitCodewhere
G: Game + Serialize + DeserializeOwned,
G::State: Serialize + DeserializeOwned,
G::Action: DeserializeOwned + Debug,
G::View: Serialize,
F: FnOnce(G, &PlayArgs) -> 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.