#![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) -> 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, } }