pub struct SessionApp<G>{ /* private fields */ }Expand description
An interactive session over a Simulator: the dashboard plus a setup
modal, Auto/Step control, speed, reset, and a human-playable seat.
Fixes the dashboard’s viewing seat at the lowest human seat (or a neutral
spectator if there is none) each time the match is (re)built, so a human
never sees another seat’s hidden information. That single fixed viewer means
a hidden-info game configured with two or more human seats is local
pass-and-play that shows one seat’s view throughout; it is not safe for
competitive hot-seat play of a game with private state (the same limitation
the CLI’s text play documents).
Implementations§
Source§impl<G> SessionApp<G>
impl<G> SessionApp<G>
Sourcepub fn new(game: G, bots: Vec<BotOption<G>>, seed: u64) -> Self
pub fn new(game: G, bots: Vec<BotOption<G>>, seed: u64) -> Self
Builds a session for game with the given bots available as AI types
(at least random_bot is always included), every seat an AI, Auto
mode, seeded from seed.
Sourcepub fn with_human_seat(self, seat: usize) -> Self
pub fn with_human_seat(self, seat: usize) -> Self
Marks seat human (it plays through the action menu). Out-of-range
seats are ignored.
Sourcepub fn with_setup_open(self, open: bool) -> Self
pub fn with_setup_open(self, open: bool) -> Self
Opens (or closes) the setup modal on start, so a native player configures seats before the match runs.
Sourcepub const fn with_step_mode(self) -> Self
pub const fn with_step_mode(self) -> Self
Starts in Step mode (advance one decision per Space) rather than Auto.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Whether the match has ended and the setup modal is closed (so a demo harness can decide when to restart).
Sourcepub fn into_simulator(self) -> Simulator<G>
pub fn into_simulator(self) -> Simulator<G>
Unwraps to the underlying Simulator at its current state.