#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EChatRoomServerMessage {
    Invalid = 0,
    RenameChatRoom = 1,
    Joined = 2,
    Parted = 3,
    Kicked = 4,
    Invited = 5,
    InviteDismissed = 8,
    ChatRoomTaglineChanged = 9,
    ChatRoomAvatarChanged = 10,
    AppCustom = 11,
}

impl EChatRoomServerMessage {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Invalid as i32 => Some(Self::Invalid),
            x if x == Self::RenameChatRoom as i32 => Some(Self::RenameChatRoom),
            x if x == Self::Joined as i32 => Some(Self::Joined),
            x if x == Self::Parted as i32 => Some(Self::Parted),
            x if x == Self::Kicked as i32 => Some(Self::Kicked),
            x if x == Self::Invited as i32 => Some(Self::Invited),
            x if x == Self::InviteDismissed as i32 => Some(Self::InviteDismissed),
            x if x == Self::ChatRoomTaglineChanged as i32 => Some(Self::ChatRoomTaglineChanged),
            x if x == Self::ChatRoomAvatarChanged as i32 => Some(Self::ChatRoomAvatarChanged),
            x if x == Self::AppCustom as i32 => Some(Self::AppCustom),
            _ => None,
        }
    }
}
