yasuki_gui.rules_runner.GameRunner#

class GameRunner(session, human, opponent=None)[source]#

Drives a single-player rules game through an EngineSession.

The human advances their own turn a phase at a time; when the turn ends, the AI-reserved opponent’s turn auto-runs until control returns to the human. A decision the human owes is left pending for the UI to present; the opponent’s decisions are answered by its Agent.

Attributes:
sessionEngineSession

The authoritative session this runner drives.

humanPlayerId

The seat the human plays.

Methods

GameRunner.__init__(session, human[, opponent])

GameRunner.ability_menu(card_id)

The activated-ability action offered for an in-play card the human controls, labelled with the ability's description, when it is legal to use now.

GameRunner.act(action)

Perform the human's chosen action.

GameRunner.cancel()

Back out of the human's pending decision, undoing the action that raised it.

GameRunner.deck_menu(deck_key)

The labeled actions for a left-click on a deck.

GameRunner.legacy_search_pool()

The cards the human's Legacy search looks through — its whole dynasty deck plus its face-down province cards — for a search dialog to display.

GameRunner.legal_actions()

Return the actions the human may take right now (empty when it is not their turn).

GameRunner.province_menu(card_id)

The labeled actions offered for a face-up province card, for its left-click menu: a plain Recruit plus its second purchase option where one exists — Invest for an Invest holding, Proclaim for an own-clan Personality (all labeled with their gold) — and a Dynasty Discard.

GameRunner.run_opponent()

Run the opponent's turn to completion: it passes each phase and lets its Agent answer any decision it owes, until control returns to the human.

GameRunner.submit(choices[, boosted])

Answer the human's pending decision with the chosen ids, and the subset whose bow-time production boost was taken (Outlying Farms paying boosted).

GameRunner.undo_last()

Undo the human's last action if it was a Dynasty Discard and nothing has happened since.

GameRunner.view()

Return the human's projection — what the board, phase bar, and panels render.

Attributes

is_opponent_turn

Whether control rests with the AI-reserved opponent, so the UI should run its turn.

loser

The seat that has lost the game, or None while it is ongoing.

pending

The decision the human must answer, or None when nothing is awaited from them.