#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EDenyReason {
    InvalidVersion = 1,
    Generic = 2,
    NotLoggedOn = 3,
    NoLicense = 4,
    Cheater = 5,
    LoggedInElseWhere = 6,
    UnknownText = 7,
    IncompatibleAnticheat = 8,
    MemoryCorruption = 9,
    IncompatibleSoftware = 10,
    SteamConnectionLost = 11,
    SteamConnectionError = 12,
    SteamResponseTimedOut = 13,
    SteamValidationStalled = 14,
    SteamOwnerLeftGuestUser = 15,
}

impl EDenyReason {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::InvalidVersion as i32 => Some(Self::InvalidVersion),
            x if x == Self::Generic as i32 => Some(Self::Generic),
            x if x == Self::NotLoggedOn as i32 => Some(Self::NotLoggedOn),
            x if x == Self::NoLicense as i32 => Some(Self::NoLicense),
            x if x == Self::Cheater as i32 => Some(Self::Cheater),
            x if x == Self::LoggedInElseWhere as i32 => Some(Self::LoggedInElseWhere),
            x if x == Self::UnknownText as i32 => Some(Self::UnknownText),
            x if x == Self::IncompatibleAnticheat as i32 => Some(Self::IncompatibleAnticheat),
            x if x == Self::MemoryCorruption as i32 => Some(Self::MemoryCorruption),
            x if x == Self::IncompatibleSoftware as i32 => Some(Self::IncompatibleSoftware),
            x if x == Self::SteamConnectionLost as i32 => Some(Self::SteamConnectionLost),
            x if x == Self::SteamConnectionError as i32 => Some(Self::SteamConnectionError),
            x if x == Self::SteamResponseTimedOut as i32 => Some(Self::SteamResponseTimedOut),
            x if x == Self::SteamValidationStalled as i32 => Some(Self::SteamValidationStalled),
            x if x == Self::SteamOwnerLeftGuestUser as i32 => Some(Self::SteamOwnerLeftGuestUser),
            _ => None,
        }
    }
}
