Skip to main content

steam_enums/
efriendrelationship.rs

1#![allow(non_camel_case_types)]
2#![allow(non_upper_case_globals)]
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4#[repr(i32)]
5pub enum EFriendRelationship {
6    None = 0,
7    Blocked = 1,
8    RequestRecipient = 2,
9    Friend = 3,
10    RequestInitiator = 4,
11    Ignored = 5,
12    IgnoredFriend = 6,
13    SuggestedFriend = 7,
14}
15
16impl EFriendRelationship {
17    pub fn from_i32(val: i32) -> Option<Self> {
18        match val {
19            x if x == Self::None as i32 => Some(Self::None),
20            x if x == Self::Blocked as i32 => Some(Self::Blocked),
21            x if x == Self::RequestRecipient as i32 => Some(Self::RequestRecipient),
22            x if x == Self::Friend as i32 => Some(Self::Friend),
23            x if x == Self::RequestInitiator as i32 => Some(Self::RequestInitiator),
24            x if x == Self::Ignored as i32 => Some(Self::Ignored),
25            x if x == Self::IgnoredFriend as i32 => Some(Self::IgnoredFriend),
26            x if x == Self::SuggestedFriend as i32 => Some(Self::SuggestedFriend),
27            _ => None,
28        }
29    }
30}