diff --git a/src/consts/game_mode.rs b/src/consts/game_mode.rs new file mode 100644 index 0000000..19d061f --- /dev/null +++ b/src/consts/game_mode.rs @@ -0,0 +1,67 @@ +// This file is automatically generated. +// Do not directly edit. + +use strum_macros::{ EnumString, Display, AsRefStr }; + +/// League of Legends game mode, such as Classic, +/// ARAM, URF, One For All, Ascension, etc. +#[derive(Debug, Copy, Clone)] +#[derive(Eq, PartialEq, Hash)] +#[derive(EnumString, Display, AsRefStr)] +#[repr(u8)] +pub enum GameMode { + /// Classic Summoner's Rift and Twisted Treeline games + #[strum(to_string="CLASSIC")] + Classic, + /// Dominion/Crystal Scar games + #[strum(to_string="ODIN")] + Odin, + /// ARAM games + #[strum(to_string="ARAM")] + Aram, + /// Tutorial games + #[strum(to_string="TUTORIAL")] + Tutorial, + /// URF games + #[strum(to_string="URF")] + Urf, + /// Doom Bot games + #[strum(to_string="DOOMBOTSTEEMO")] + Doombotsteemo, + /// One for All games + #[strum(to_string="ONEFORALL")] + Oneforall, + /// Ascension games + #[strum(to_string="ASCENSION")] + Ascension, + /// Snowdown Showdown games + #[strum(to_string="FIRSTBLOOD")] + Firstblood, + /// Legend of the Poro King games + #[strum(to_string="KINGPORO")] + Kingporo, + /// Nexus Siege games + #[strum(to_string="SIEGE")] + Siege, + /// Blood Hunt Assassin games + #[strum(to_string="ASSASSINATE")] + Assassinate, + /// All Random Summoner's Rift games + #[strum(to_string="ARSR")] + Arsr, + /// Dark Star: Singularity games + #[strum(to_string="DARKSTAR")] + Darkstar, + /// Star Guardian Invasion games + #[strum(to_string="STARGUARDIAN")] + Starguardian, + /// PROJECT: Hunters games + #[strum(to_string="PROJECT")] + Project, + /// Nexus Blitz games + #[strum(to_string="GAMEMODEX")] + Gamemodex, + /// Odyssey: Extraction games + #[strum(to_string="ODYSSEY")] + Odyssey, +} diff --git a/src/consts/mod.rs b/src/consts/mod.rs index ad95fab..1f5de0d 100644 --- a/src/consts/mod.rs +++ b/src/consts/mod.rs @@ -6,6 +6,9 @@ pub use champion::*; mod division; pub use division::*; +mod game_mode; +pub use game_mode::*; + mod game_type; pub use game_type::*; diff --git a/srcgen/consts/game_mode.rs.dt b/srcgen/consts/game_mode.rs.dt new file mode 100644 index 0000000..f809515 --- /dev/null +++ b/srcgen/consts/game_mode.rs.dt @@ -0,0 +1,24 @@ +{{ + const dotUtils = require('./dotUtils.js'); + const gameModes = require('./.gameModes.json'); +}}{{= dotUtils.preamble() }} + +use strum_macros::{ EnumString, Display, AsRefStr }; + +/// League of Legends game mode, such as Classic, +/// ARAM, URF, One For All, Ascension, etc. +#[derive(Debug, Copy, Clone)] +#[derive(Eq, PartialEq, Hash)] +#[derive(EnumString, Display, AsRefStr)] +#[repr(u8)] +pub enum GameMode { +{{ + for (const { gameMode, description } of gameModes) { +}} + /// {{= description }} + #[strum(to_string="{{= gameMode }}")] + {{= dotUtils.changeCase.pascalCase(gameMode) }}, +{{ + } +}} +} diff --git a/srcgen/index.js b/srcgen/index.js index faf2651..e354ed6 100644 --- a/srcgen/index.js +++ b/srcgen/index.js @@ -26,6 +26,10 @@ const files = [ [ 'http://static.developer.riotgames.com/docs/lol/gameTypes.json', '.gameTypes.json' + ], + [ + 'http://static.developer.riotgames.com/docs/lol/gameModes.json', + '.gameModes.json' ] ]