//! The client's own label of a player (`villains[].marke`), used until we have numbers. //! //! Assumption, not measured: a player the client marks as a beginner or fish plays like a passive //! calling station. No marked player exists in the logs so far (`specialPlayerTagConfig` is off at //! the measured tables), so these values are unchecked. Measured fields always win. use super::profile::Profile; /// What a beginner or fish is assumed to do where nothing is measured. The HUD extras stay unknown: /// the label is a coarse prior, no basis to invent continuation or showdown frequencies. const WEAK_PLAYER: Profile = Profile { vpip: Some(0.45), pfr: Some(0.10), fold_to_bet: Some(0.25), aggression: Some(0.20), cbet: None, fold_to_cbet: None, three_bet: None, fold_to_three_bet: None, steal: None, check_raise: None, wtsd: None, wsd: None, }; fn prior(mark: &str) -> Option { matches!(mark, "Anfaenger" | "FISH").then_some(WEAK_PLAYER) } /// `measured` with its missing fields filled from the mark. Unknown marks change nothing. pub fn with_mark(measured: Option, mark: &str) -> Option { let Some(prior) = prior(mark) else { return measured; }; let known = measured.unwrap_or_default(); Some(Profile { vpip: known.vpip.or(prior.vpip), pfr: known.pfr.or(prior.pfr), fold_to_bet: known.fold_to_bet.or(prior.fold_to_bet), aggression: known.aggression.or(prior.aggression), cbet: known.cbet.or(prior.cbet), fold_to_cbet: known.fold_to_cbet.or(prior.fold_to_cbet), three_bet: known.three_bet.or(prior.three_bet), fold_to_three_bet: known.fold_to_three_bet.or(prior.fold_to_three_bet), steal: known.steal.or(prior.steal), check_raise: known.check_raise.or(prior.check_raise), wtsd: known.wtsd.or(prior.wtsd), wsd: known.wsd.or(prior.wsd), }) }