Skip to main content

Crate turnbase_simulator

Crate turnbase_simulator 

Source
Expand description

Interactive human client for turnbase: a fixed retroglyph terminal dashboard over a turnbase_match::Simulator.

The turn loop itself (Simulator, PlayerAgent) lives in turnbase-match and has no rendering in its call path; this crate adds the human-facing layer. SimulationRunner binds straight to retroglyph-core primitives (Terminal, Rect, print) rather than introducing a layout engine or widget abstraction of its own; a game opts in by implementing PrintableGame and drawing into the rect it is handed.

Simulator and PlayerAgent are re-exported so a dashboard user builds a match without depending on turnbase-match directly.

Structs§

BotOption
One selectable AI type for a seat.
SessionApp
An interactive session over a Simulator: the dashboard plus a setup modal, Auto/Step control, speed, reset, and a human-playable seat.
SimulationRunner
Drives a Simulator behind a fixed dashboard.
Simulator
Coordinates one match: the rules (G), its current position, which agent controls each seat, and a running log of committed actions.

Enums§

PlayerAgent
Who is deciding a seat’s moves.

Traits§

PrintableGame
A Game that knows how to render itself, for SimulationRunner.

Functions§

ismcts_bot
The information-set MCTS bot option, for a game that implements Determinize (so it can search under hidden information).
mcts_bot
The MCTS bot option, for any game whose state and actions are Clone.
random_bot
The uniform-random bot option, available for every game.
run
Runs simulator on a real terminal via retroglyph-crossterm, polling an AI-controlled seat every ai_tick, until the match ends or the terminal closes.
run_session
Runs app on a real terminal via retroglyph-crossterm until it quits.
standard_bots
The bot set every Clone-stated game can offer: random_bot and mcts_bot. A game that also implements Determinize can push ismcts_bot on top.