yasuki_core.engine.rules.log#

Classes

Act(seat, action)

Tape entry: the active player took an action — a pass or a card action.

Answer(seat, response)

Tape entry: the active player answered the pending decision.

Cancel(seat)

Tape entry: the active player backed out of the pending decision, undoing the action that raised it.

GameLog(initial, first_player[, seed, entries])

An append-only record of a rules-driven game: a start snapshot at the head, then the ordered tape of engine inputs.

Functions

act_and_log(game, log, action)

Perform action for the active seat and record it.

build_game(log)

Rebuild the starting GameState from log: its snapshot table, first player, and seed, with the first turn's start-of-turn housekeeping already run.

cancel_and_log(game, log)

Cancel the pending decision and, on success, record it.

game_log_from_dict(payload)

Reconstruct a GameLog from the plain data produced by game_log_to_dict().

game_log_to_dict(log)

Serialize a whole GameLog — snapshot and tape — to JSON-ready plain data.

replay(log)

Deterministically rebuild the final game state by re-running the engine from the start snapshot and feeding each logged input in order.

submit_and_log(game, log, response)

Answer the pending decision and, on success, record it.