yasuki_core.engine.session.EngineSession#
- class EngineSession(game, log)[source]#
The single surface a client plays a rules-driven game through.
Owns the authoritative
GameStateand the append-onlyGameLog, 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, sologalways replays to the currentgame.- Attributes:
- game
GameState The authoritative game state.
- log
GameLog The tape of accepted inputs, replayable to
game.
- game
Methods
EngineSession.__init__(game, log)EngineSession.act(seat, action)Perform
actionforseatand record it.EngineSession.cancel(seat)Back out of
seat's pending decision, undoing the action that raised it, and record it.Return the free actions
seatmay 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
seatis 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
gamelog