#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EGameSearchResult {
    Invalid = 0,
    SearchInProgress = 1,
    SearchFailedNoHosts = 2,
    SearchGameFound = 3,
    SearchCompleteAccepted = 4,
    SearchCompleteDeclined = 5,
    SearchCanceled = 6,
}

impl EGameSearchResult {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Invalid as i32 => Some(Self::Invalid),
            x if x == Self::SearchInProgress as i32 => Some(Self::SearchInProgress),
            x if x == Self::SearchFailedNoHosts as i32 => Some(Self::SearchFailedNoHosts),
            x if x == Self::SearchGameFound as i32 => Some(Self::SearchGameFound),
            x if x == Self::SearchCompleteAccepted as i32 => Some(Self::SearchCompleteAccepted),
            x if x == Self::SearchCompleteDeclined as i32 => Some(Self::SearchCompleteDeclined),
            x if x == Self::SearchCanceled as i32 => Some(Self::SearchCanceled),
            _ => None,
        }
    }
}
