#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EValveIndexComponent {
    Unknown = 0,
    HMD = 1,
    LeftKnuckle = 2,
    RightKnuckle = 3,
    SteamFrameHMD = 4,
    SteamFrameLeftController = 5,
    SteamFrameRightController = 6,
    SteamFrameWirelessAdapter = 7,
}

impl EValveIndexComponent {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::Unknown as i32 => Some(Self::Unknown),
            x if x == Self::HMD as i32 => Some(Self::HMD),
            x if x == Self::LeftKnuckle as i32 => Some(Self::LeftKnuckle),
            x if x == Self::RightKnuckle as i32 => Some(Self::RightKnuckle),
            x if x == Self::SteamFrameHMD as i32 => Some(Self::SteamFrameHMD),
            x if x == Self::SteamFrameLeftController as i32 => Some(Self::SteamFrameLeftController),
            x if x == Self::SteamFrameRightController as i32 => Some(Self::SteamFrameRightController),
            x if x == Self::SteamFrameWirelessAdapter as i32 => Some(Self::SteamFrameWirelessAdapter),
            _ => None,
        }
    }
}
