Skip to main content

steam_enums/
echatentrytype.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 EChatEntryType {
6    Invalid = 0,
7    ChatMsg = 1,
8    Typing = 2,
9    InviteGame = 3,
10    Emote = 4,
11    LobbyGameStart = 5,
12    LeftConversation = 6,
13    Entered = 7,
14    WasKicked = 8,
15    WasBanned = 9,
16    Disconnected = 10,
17    HistoricalChat = 11,
18    Reserved1 = 12,
19    Reserved2 = 13,
20    LinkBlocked = 14,
21}
22
23impl EChatEntryType {
24    pub fn from_i32(val: i32) -> Option<Self> {
25        match val {
26            x if x == Self::Invalid as i32 => Some(Self::Invalid),
27            x if x == Self::ChatMsg as i32 => Some(Self::ChatMsg),
28            x if x == Self::Typing as i32 => Some(Self::Typing),
29            x if x == Self::InviteGame as i32 => Some(Self::InviteGame),
30            x if x == Self::Emote as i32 => Some(Self::Emote),
31            x if x == Self::LobbyGameStart as i32 => Some(Self::LobbyGameStart),
32            x if x == Self::LeftConversation as i32 => Some(Self::LeftConversation),
33            x if x == Self::Entered as i32 => Some(Self::Entered),
34            x if x == Self::WasKicked as i32 => Some(Self::WasKicked),
35            x if x == Self::WasBanned as i32 => Some(Self::WasBanned),
36            x if x == Self::Disconnected as i32 => Some(Self::Disconnected),
37            x if x == Self::HistoricalChat as i32 => Some(Self::HistoricalChat),
38            x if x == Self::Reserved1 as i32 => Some(Self::Reserved1),
39            x if x == Self::Reserved2 as i32 => Some(Self::Reserved2),
40            x if x == Self::LinkBlocked as i32 => Some(Self::LinkBlocked),
41            _ => None,
42        }
43    }
44}