Secures work in progress so the rake branch and the shell repo can be merged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
1.2 KiB
Rust
34 lines
1.2 KiB
Rust
//! 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.
|
|
const WEAK_PLAYER: Profile = Profile {
|
|
vpip: Some(0.45),
|
|
pfr: Some(0.10),
|
|
fold_to_bet: Some(0.25),
|
|
aggression: Some(0.20),
|
|
};
|
|
|
|
fn prior(mark: &str) -> Option<Profile> {
|
|
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<Profile>, mark: &str) -> Option<Profile> {
|
|
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),
|
|
})
|
|
}
|