rosu_memory_lib/reader/gameplay/
mod.rs

1pub mod common;
2pub mod stable;
3
4use crate::impl_osu_accessor;
5use crate::reader::common::OsuClientKind;
6use crate::reader::gameplay::common::GameplayInfo;
7use crate::reader::structs::Hit;
8use crate::reader::structs::State;
9use crate::Error;
10use rosu_mem::process::Process;
11pub struct GameplayReader<'a> {
12    pub process: &'a Process,
13    pub state: &'a mut State,
14    pub osu_type: OsuClientKind,
15}
16
17impl<'a> GameplayReader<'a> {
18    pub fn new(p: &'a Process, state: &'a mut State, osu_type: OsuClientKind) -> Self {
19        Self {
20            process: p,
21            state,
22            osu_type,
23        }
24    }
25    impl_osu_accessor! {
26        fn score() -> i32 => stable::memory::score,
27        fn mods() -> u32 => stable::memory::mods,
28        fn combo() -> i16 => stable::memory::combo,
29        fn max_combo() -> i16 => stable::memory::max_combo,
30        fn hp() -> f64 => stable::memory::hp,
31        fn username() -> String => stable::memory::username,
32        fn game_time() -> i32 => stable::memory::game_time,
33        fn retries() -> i32 => stable::memory::retries,
34        fn hits() -> Hit => stable::memory::hits,
35        fn hits_300() -> i16 => stable::memory::hits_300,
36        fn hits_100() -> i16 => stable::memory::hits_100,
37        fn hits_50() -> i16 => stable::memory::hits_50,
38        fn hits_miss() -> i16 => stable::memory::hits_miss,
39        fn hits_geki() -> i16 => stable::memory::hits_geki,
40        fn hits_katu() -> i16 => stable::memory::hits_katu,
41        fn info() -> GameplayInfo => stable::memory::info,
42
43    }
44}