Function get_beatmap_path

Source
pub fn get_beatmap_path(p: &Process, state: &mut State) -> Result<String>
Examples found in repository?
examples/pp.rs (line 97)
95fn process_game_state(process: &Process, state: &mut State, calc_state: &mut CalculatorState) -> Result<()> {
96    let mut mods_changed = false;
97    match get_beatmap_path(process, state) {
98        Ok(beatmap_path) => {
99            // Update mods if they changed
100            if let Ok(new_mods) = get_menu_mods(process, state) {
101                mods_changed = calc_state.update_mods(new_mods);
102            }
103
104            // Update beatmap if path changed and mods changed else it's useless to recalculate 
105            if calc_state.update_beatmap(beatmap_path)? && mods_changed {
106                calc_state.update_pp(); 
107            }
108        }
109        Err(e) => {
110            eprintln!("Failed to read beatmap path: {e}");
111        }
112    }
113    Ok(())
114}