Skip to main content

steam_enums/
elicensetype.rs

1#![allow(non_camel_case_types)]
2#![allow(non_upper_case_globals)]
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4#[repr(i32)]
5pub enum ELicenseType {
6    NoLicense = 0,
7    SinglePurchase = 1,
8    SinglePurchaseLimitedUse = 2,
9    RecurringCharge = 3,
10    RecurringChargeLimitedUse = 4,
11    RecurringChargeLimitedUseWithOverages = 5,
12    RecurringOption = 6,
13    LimitedUseDelayedActivation = 7,
14}
15
16impl ELicenseType {
17    pub fn from_i32(val: i32) -> Option<Self> {
18        match val {
19            x if x == Self::NoLicense as i32 => Some(Self::NoLicense),
20            x if x == Self::SinglePurchase as i32 => Some(Self::SinglePurchase),
21            x if x == Self::SinglePurchaseLimitedUse as i32 => Some(Self::SinglePurchaseLimitedUse),
22            x if x == Self::RecurringCharge as i32 => Some(Self::RecurringCharge),
23            x if x == Self::RecurringChargeLimitedUse as i32 => Some(Self::RecurringChargeLimitedUse),
24            x if x == Self::RecurringChargeLimitedUseWithOverages as i32 => Some(Self::RecurringChargeLimitedUseWithOverages),
25            x if x == Self::RecurringOption as i32 => Some(Self::RecurringOption),
26            x if x == Self::LimitedUseDelayedActivation as i32 => Some(Self::LimitedUseDelayedActivation),
27            _ => None,
28        }
29    }
30}