yasuki_core.engine.session.EngineSession#

class EngineSession(game, log)[source]#

The single surface a client plays a rules-driven game through.

Owns the authoritative GameState and the append-only GameLog, and exposes the three engine-to-client channels: a per-seat projection, a legal-action query, and decision submission — plus turn advancement. Every accepted input is recorded, so log always replays to the current game.

Attributes:
gameGameState

The authoritative game state.

logGameLog

The tape of accepted inputs, replayable to game.

Methods

EngineSession.__init__(game, log)

EngineSession.act(seat, action)

Perform action for seat and record it.

EngineSession.cancel(seat)

Back out of seat's pending decision, undoing the action that raised it, and record it.

EngineSession.legal_actions(seat)

Return the free actions seat may take right now: always a pass, plus — in the Dynasty phase — a Recruit for each face-up Holding or Personality in its provinces it could pay for.

EngineSession.project(seat)

Return the view seat is entitled to.

EngineSession.start(table, first_player, *)

Open a session on a dealt table.

EngineSession.submit(seat, response)

Answer the pending decision and record it.

EngineSession.undo_last(seat)

Undo seat's most recent action when it was a Dynasty Discard and no decision is pending — the one free action safe to reverse, as it has no cost and does not advance the turn.

Attributes

game

log