//! One chart line: percentile cut-offs (a hand continues if its percentile is *below* the cut-off). #[derive(Clone, Copy, Debug, PartialEq)] pub struct ChartRow { /// Hands better than this raise (open, isolate, 3-bet, 4-bet). pub raise: f64, /// Hands better than this, but outside the raise range, call/limp/check. Includes `raise`. pub call: f64, /// Hands better than this go all-in (takes precedence over `raise`). pub jam: f64, } impl ChartRow { pub const fn new(raise: f64, call: f64, jam: f64) -> ChartRow { ChartRow { raise, call, jam } } /// Every cut-off multiplied by `factor` and kept inside `[0, 1]`. pub fn scaled(self, factor: f64) -> ChartRow { let apply = |c: f64| (c * factor).clamp(0.0, 1.0); ChartRow::new(apply(self.raise), apply(self.call), apply(self.jam)) } /// The widest continuing cut-off. pub fn widest(self) -> f64 { self.raise.max(self.call).max(self.jam) } }