Files
mmintel 04d5251acf Welt ohne fremden Namen: Pruefordner vollstaendig mitkopieren, Engine nur im eigenen Baum
Die Welt nannte 'pokerfreak' nur noch in zwei Harness-Zeilen - der Rest waren veraltete
Rust-Pruefungen im Pruefordner, die der Aufbau nie auffrischte.
2026-11-01 23:37:11 +01:00

46 lines
1.3 KiB
Rust

#![allow(dead_code)]
//! Builders for button-inference tests.
use rechner::card::Card;
use rechner::game::{ActionKind, ActionRecord, SeenAction, Spot, Street, Villain};
use rechner::variant::Variant;
pub fn post_sb(seat: u8) -> ActionRecord {
rec(seat, SeenAction::PostSmallBlind)
}
pub fn post_bb(seat: u8) -> ActionRecord {
rec(seat, SeenAction::PostBigBlind)
}
pub fn rec(seat: u8, action: SeenAction) -> ActionRecord {
ActionRecord { street: Street::Preflop, seat, action, amount: None }
}
/// Preflop NLHE, big blind 1, pot 1.5, 1 to call; no button, no history.
pub fn spot(seats: u8, hero_seat: u8, villain_seats: &[u8], history: Vec<ActionRecord>) -> Spot {
Spot {
variant: Variant::Nlhe,
big_blind: 1.0,
seats,
hero_seat,
button_seat: None,
hero_cards: Card::parse_list("Ah Kh").unwrap(),
board: vec![],
street: Street::Preflop,
pot: 1.5,
to_call: 1.0,
hero_stack: 100.0,
min_raise_to: Some(2.0),
max_raise_to: Some(100.0),
legal: vec![ActionKind::Fold, ActionKind::Call, ActionKind::Raise],
allowed_sizes: None,
villains: villain_seats
.iter()
.map(|s| Villain { seat: *s, stack: 100.0, folded: false, profile: None })
.collect(),
seed: 1,
history,
}
}