Skip to main content

Crate rbp_gameplay

Crate rbp_gameplay 

Source
Expand description

Poker game engine with state management, action handling, and settlement.

This module implements the rules and mechanics of No-Limit Texas Hold’em, tracking game state across betting rounds and resolving showdowns.

§State Representation

  • Game — The memoryless present: stacks, pot, board, and active players
  • Partial — The remembered past: complete action history for a hand
  • Path — Compressed action sequence for tree traversal

§Actions

  • Action — A player decision: fold, check, call, or raise
  • Edge — A game tree transition with the acting player
  • Odds — Pot odds abstraction for bet sizing (1/3, 1/2, 2/3, pot, all-in)

§Resolution

  • Showdown — Final hand comparison when multiple players remain
  • Settlement — Pot distribution with side-pot handling
  • PnL — Profit and loss accounting per player

§Supporting Types

  • Seat — Player position and stack at the table
  • Turn — Whose action it is and what options they have
  • Arrangement — Positional configuration for heads-up or multiway
  • Abstraction — Abstract bucket assignment for strategic equivalence

§Information Levels

  • Partial — Partial information: hero’s cards only (concrete)
  • Perfect — Complete information: both players’ cards (concrete)

Structs§

Abstraction
A discrete bucket representing strategically similar hands.
Arrangement
An ordered sequence of up to 7 cards as dealt.
Game
The memoryless state of a poker hand.
Hands
Iterator over completed hands in a session.
Odds
Pot-relative bet sizing as a fraction.
Partial
Perfect-recall game history from a single player’s perspective.
Path
A compact sequence of abstract edges packed into 64 bits.
Perfect
Complete game history with both players’ cards known.
Perpetual
Infinite iterator over actions across games.
PnL
Public profit/loss information.
Seat
A player’s state at the table.
Session
Iterator over actions in a session.
Settlement
A player’s final result including hand strength.
Showdown
Computes chip distributions at showdown.

Enums§

Action
A player decision or chance event in the game.
Edge
An abstracted game tree transition.
PositionName
Named position at a poker table relative to the dealer button.
Size
Abstract bet sizing for Edge::Raise.
State
Player betting status within a hand.
Turn
Whose turn it is to act in the game tree.

Traits§

Recall
A game history that can be replayed from a root state.