steam_enums/
epersonastate.rs1#![allow(non_camel_case_types)]
2#![allow(non_upper_case_globals)]
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4#[repr(i32)]
5pub enum EPersonaState {
6 Offline = 0,
7 Online = 1,
8 Busy = 2,
9 Away = 3,
10 Snooze = 4,
11 LookingToTrade = 5,
12 LookingToPlay = 6,
13 Invisible = 7,
14}
15
16impl EPersonaState {
17 pub fn from_i32(val: i32) -> Option<Self> {
18 match val {
19 x if x == Self::Offline as i32 => Some(Self::Offline),
20 x if x == Self::Online as i32 => Some(Self::Online),
21 x if x == Self::Busy as i32 => Some(Self::Busy),
22 x if x == Self::Away as i32 => Some(Self::Away),
23 x if x == Self::Snooze as i32 => Some(Self::Snooze),
24 x if x == Self::LookingToTrade as i32 => Some(Self::LookingToTrade),
25 x if x == Self::LookingToPlay as i32 => Some(Self::LookingToPlay),
26 x if x == Self::Invisible as i32 => Some(Self::Invisible),
27 _ => None,
28 }
29 }
30}