Die Welt soll nichts verraten. Woerter, die ein Gegenueber implizieren (echt vs. unecht, live, Mensch), sind aus Prosa, Kommentaren und Docstrings raus; Namen (mensch_ruhe_s, echte_chops) und der Altwert "echt" im Spielplan bleiben. Nur Kommentare und Docstrings angefasst, damit keine Einrueckung faellt.
60 lines
1.7 KiB
Rust
60 lines
1.7 KiB
Rust
//! The two decks the generator produces tables for, and where their frozen files.
|
|
|
|
use crate::variant::Variant;
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
|
pub enum ChartDeck {
|
|
/// 52 cards, hold'em (NLHE and AOF share the tables).
|
|
Full,
|
|
/// 36 cards, short deck rules (flush over full house, A-6-7-8-9).
|
|
Short,
|
|
}
|
|
|
|
impl ChartDeck {
|
|
pub fn variant(self) -> Variant {
|
|
match self {
|
|
ChartDeck::Full => Variant::Nlhe,
|
|
ChartDeck::Short => Variant::ShortDeck,
|
|
}
|
|
}
|
|
|
|
/// The deck whose tables a variant uses; `None` for variants without CFR tables.
|
|
pub fn of(variant: Variant) -> Option<ChartDeck> {
|
|
match variant {
|
|
Variant::Nlhe | Variant::Aof => Some(ChartDeck::Full),
|
|
Variant::ShortDeck => Some(ChartDeck::Short),
|
|
_ => None,
|
|
}
|
|
}
|
|
|
|
/// Command-line value of `chartgen --deck`.
|
|
pub fn flag(self) -> &'static str {
|
|
match self {
|
|
ChartDeck::Full => "full",
|
|
ChartDeck::Short => "short",
|
|
}
|
|
}
|
|
|
|
pub fn equity_file(self) -> &'static str {
|
|
match self {
|
|
ChartDeck::Full => "src/cfr/generated_equity.rs",
|
|
ChartDeck::Short => "src/cfr/generated_equity_short.rs",
|
|
}
|
|
}
|
|
|
|
pub fn charts_file(self) -> &'static str {
|
|
match self {
|
|
ChartDeck::Full => "src/preflop/generated_charts.rs",
|
|
ChartDeck::Short => "src/preflop/generated_charts_short.rs",
|
|
}
|
|
}
|
|
|
|
/// `" --deck short"` for the short deck, empty for the default.
|
|
pub fn deck_argument(self) -> &'static str {
|
|
match self {
|
|
ChartDeck::Full => "",
|
|
ChartDeck::Short => " --deck short",
|
|
}
|
|
}
|
|
}
|