15 lines
578 B
Rust
15 lines
578 B
Rust
use super::allowed::valid_allowed;
|
|
use super::bounds::bounds;
|
|
use crate::game::Spot;
|
|
|
|
/// The jam size: with `allowed_sizes`, the largest usable entry; otherwise
|
|
/// `min(max_raise_to, hero_stack)` (the stack when no max). `None` when that is not
|
|
/// a legal raise size (no chips, or below `min_raise_to`). For pot-limit variants
|
|
/// the "jam" is the pot-sized raise when that is smaller than the stack.
|
|
pub fn all_in(spot: &Spot) -> Option<f64> {
|
|
match valid_allowed(spot) {
|
|
Some(sizes) => sizes.last().copied(),
|
|
None => bounds(spot).map(|b| b.hi),
|
|
}
|
|
}
|