rosu_memory_lib/reader/user/
mod.rs

1pub mod common;
2pub mod stable;
3use crate::impl_osu_accessor;
4use crate::reader::common::OsuClientKind;
5use crate::reader::structs::State;
6use crate::reader::user::common::UserInfo;
7use crate::Error;
8use rosu_mem::process::Process;
9pub struct UserReader<'a> {
10    pub process: &'a Process,
11    pub state: &'a mut State,
12    pub osu_type: OsuClientKind,
13}
14
15impl<'a> UserReader<'a> {
16    pub fn new(p: &'a Process, state: &'a mut State, osu_type: OsuClientKind) -> Self {
17        Self {
18            process: p,
19            state,
20            osu_type,
21        }
22    }
23    impl_osu_accessor! {
24        fn id() -> i32 => stable::memory::id,
25        fn bancho_status() -> i32 => stable::memory::bancho_status,
26        fn country_code() -> i32 => stable::memory::country_code,
27        fn username() -> String => stable::memory::username,
28        fn pp() -> i32 => stable::memory::pp,
29        fn rankedscore() -> i64 => stable::memory::rankedscore,
30        fn level() -> f32 => stable::memory::level,
31        fn playcount() -> i32 => stable::memory::playcount,
32        fn rank() -> i32 => stable::memory::rank,
33        fn playmode() -> i32 => stable::memory::playmode,
34        fn accuracy() -> f64 => stable::memory::accuracy,
35        fn info() -> UserInfo => stable::memory::info,
36    }
37}