#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum ERegionCode {
    USEast = 0x00,
    USWest = 0x01,
    SouthAmerica = 0x02,
    Europe = 0x03,
    Asia = 0x04,
    Australia = 0x05,
    MiddleEast = 0x06,
    Africa = 0x07,
    World = 0xFF,
}

impl ERegionCode {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::USEast as i32 => Some(Self::USEast),
            x if x == Self::USWest as i32 => Some(Self::USWest),
            x if x == Self::SouthAmerica as i32 => Some(Self::SouthAmerica),
            x if x == Self::Europe as i32 => Some(Self::Europe),
            x if x == Self::Asia as i32 => Some(Self::Asia),
            x if x == Self::Australia as i32 => Some(Self::Australia),
            x if x == Self::MiddleEast as i32 => Some(Self::MiddleEast),
            x if x == Self::Africa as i32 => Some(Self::Africa),
            x if x == Self::World as i32 => Some(Self::World),
            _ => None,
        }
    }
}
