2021-06-30 23:34:34 +00:00
|
|
|
{{
|
|
|
|
const dotUtils = require('./dotUtils.js');
|
|
|
|
const gameModes = require('./.gameModes.json');
|
|
|
|
}}{{= dotUtils.preamble() }}
|
|
|
|
|
2022-02-09 06:28:48 +00:00
|
|
|
use serde::{ Serialize, Deserialize };
|
2021-07-01 02:35:08 +00:00
|
|
|
use strum_macros::{ EnumString, IntoStaticStr };
|
2021-06-30 23:34:34 +00:00
|
|
|
|
|
|
|
/// League of Legends game mode, such as Classic,
|
|
|
|
/// ARAM, URF, One For All, Ascension, etc.
|
|
|
|
#[non_exhaustive]
|
2021-07-01 02:35:08 +00:00
|
|
|
#[derive(Debug, Clone)]
|
2021-06-30 23:34:34 +00:00
|
|
|
#[derive(Eq, PartialEq, Hash)]
|
2021-07-01 02:35:08 +00:00
|
|
|
#[derive(EnumString, IntoStaticStr)]
|
2022-02-09 06:28:48 +00:00
|
|
|
#[derive(Serialize, Deserialize)]
|
2021-06-30 23:34:34 +00:00
|
|
|
#[repr(u8)]
|
|
|
|
pub enum GameMode {
|
2022-02-09 01:17:47 +00:00
|
|
|
/// Catch-all variant for new, unknown game modes.
|
2021-07-01 02:35:08 +00:00
|
|
|
#[strum(default)]
|
|
|
|
UNKNOWN(String),
|
|
|
|
|
2021-06-30 23:34:34 +00:00
|
|
|
{{
|
|
|
|
for (const e of gameModes) {
|
|
|
|
const desc = e['x-desc'] ? e['x-desc'].split('\n') : [];
|
|
|
|
}}
|
|
|
|
{{~ desc :line }}
|
|
|
|
/// {{= line }}
|
|
|
|
{{~}}
|
|
|
|
{{= e['x-name'] }},
|
|
|
|
{{
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
2021-07-01 02:35:08 +00:00
|
|
|
string_enum_str!(GameMode);
|