Change enum variants to use SCREAMING_SNAKE_CASE since they are really sets of constants

pull/5/head
Mingwei Samuel 2019-10-27 01:52:55 -07:00
parent 2511734bd5
commit b230f266e1
16 changed files with 152 additions and 180 deletions

View File

@ -10,7 +10,7 @@ use std::fmt;
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
use serde_repr::{ Serialize_repr, Deserialize_repr }; use serde_repr::{ Serialize_repr, Deserialize_repr };
/// League of Legends champions. /// League of Legend's champions.
/// ///
/// The documentation of each variant specifies:<br> /// The documentation of each variant specifies:<br>
/// NAME (`IDENTIFIER`, ID). /// NAME (`IDENTIFIER`, ID).

View File

@ -1,5 +1,3 @@
#![allow(deprecated)]
use std::cmp::Ordering; use std::cmp::Ordering;
use strum_macros::{ EnumString, Display, AsRefStr }; use strum_macros::{ EnumString, Display, AsRefStr };

View File

@ -16,59 +16,41 @@ use strum_macros::{ EnumString, Display, AsRefStr };
#[repr(u8)] #[repr(u8)]
pub enum GameMode { pub enum GameMode {
/// Classic Summoner's Rift and Twisted Treeline games /// Classic Summoner's Rift and Twisted Treeline games
#[strum(to_string="CLASSIC")] CLASSIC,
Classic,
/// Dominion/Crystal Scar games /// Dominion/Crystal Scar games
#[strum(to_string="ODIN")] ODIN,
Odin,
/// ARAM games /// ARAM games
#[strum(to_string="ARAM")] ARAM,
Aram,
/// Tutorial games /// Tutorial games
#[strum(to_string="TUTORIAL")] TUTORIAL,
Tutorial,
/// URF games /// URF games
#[strum(to_string="URF")] URF,
Urf,
/// Doom Bot games /// Doom Bot games
#[strum(to_string="DOOMBOTSTEEMO")] DOOMBOTSTEEMO,
Doombotsteemo,
/// One for All games /// One for All games
#[strum(to_string="ONEFORALL")] ONEFORALL,
Oneforall,
/// Ascension games /// Ascension games
#[strum(to_string="ASCENSION")] ASCENSION,
Ascension,
/// Snowdown Showdown games /// Snowdown Showdown games
#[strum(to_string="FIRSTBLOOD")] FIRSTBLOOD,
Firstblood,
/// Legend of the Poro King games /// Legend of the Poro King games
#[strum(to_string="KINGPORO")] KINGPORO,
Kingporo,
/// Nexus Siege games /// Nexus Siege games
#[strum(to_string="SIEGE")] SIEGE,
Siege,
/// Blood Hunt Assassin games /// Blood Hunt Assassin games
#[strum(to_string="ASSASSINATE")] ASSASSINATE,
Assassinate,
/// All Random Summoner's Rift games /// All Random Summoner's Rift games
#[strum(to_string="ARSR")] ARSR,
Arsr,
/// Dark Star: Singularity games /// Dark Star: Singularity games
#[strum(to_string="DARKSTAR")] DARKSTAR,
Darkstar,
/// Star Guardian Invasion games /// Star Guardian Invasion games
#[strum(to_string="STARGUARDIAN")] STARGUARDIAN,
Starguardian,
/// PROJECT: Hunters games /// PROJECT: Hunters games
#[strum(to_string="PROJECT")] PROJECT,
Project,
/// Nexus Blitz games /// Nexus Blitz games
#[strum(to_string="GAMEMODEX")] GAMEMODEX,
Gamemodex,
/// Odyssey: Extraction games /// Odyssey: Extraction games
#[strum(to_string="ODYSSEY")] ODYSSEY,
Odyssey,
} }
serde_string!(GameMode); serde_string!(GameMode);

View File

@ -15,14 +15,11 @@ use strum_macros::{ EnumString, Display, AsRefStr };
#[repr(u8)] #[repr(u8)]
pub enum GameType { pub enum GameType {
/// Custom games /// Custom games
#[strum(to_string="CUSTOM_GAME")] CUSTOM_GAME,
CustomGame,
/// Tutorial games /// Tutorial games
#[strum(to_string="TUTORIAL_GAME")] TUTORIAL_GAME,
TutorialGame,
/// all other games /// all other games
#[strum(to_string="MATCHED_GAME")] MATCHED_GAME,
MatchedGame,
} }
serde_string!(GameType); serde_string!(GameType);

View File

@ -19,54 +19,54 @@ pub enum Map {
/// Summoner's Rift /// Summoner's Rift
/// <br>Original Summer variant /// <br>Original Summer variant
SummonersRiftOriginalSummerVariant = 1, SUMMONERS_RIFT_ORIGINAL_SUMMER_VARIANT = 1,
/// Summoner's Rift /// Summoner's Rift
/// <br>Original Autumn variant /// <br>Original Autumn variant
SummonersRiftOriginalAutumnVariant = 2, SUMMONERS_RIFT_ORIGINAL_AUTUMN_VARIANT = 2,
/// Summoner's Rift /// Summoner's Rift
/// <br>Current Version /// <br>Current Version
SummonersRift = 11, SUMMONERS_RIFT = 11,
/// The Proving Grounds /// The Proving Grounds
/// <br>Tutorial Map /// <br>Tutorial Map
TheProvingGrounds = 3, THE_PROVING_GROUNDS = 3,
/// Twisted Treeline /// Twisted Treeline
/// <br>Original Version /// <br>Original Version
TwistedTreelineOriginalVersion = 4, TWISTED_TREELINE_ORIGINAL_VERSION = 4,
/// Twisted Treeline /// Twisted Treeline
/// <br>Last TT map /// <br>Last TT map
TwistedTreeline = 10, TWISTED_TREELINE = 10,
/// The Crystal Scar /// The Crystal Scar
/// <br>Dominion map /// <br>Dominion map
TheCrystalScar = 8, THE_CRYSTAL_SCAR = 8,
/// Howling Abyss /// Howling Abyss
/// <br>ARAM map /// <br>ARAM map
HowlingAbyss = 12, HOWLING_ABYSS = 12,
/// Butcher's Bridge /// Butcher's Bridge
/// <br>Alternate ARAM map /// <br>Alternate ARAM map
ButchersBridge = 14, BUTCHERS_BRIDGE = 14,
/// Cosmic Ruins /// Cosmic Ruins
/// <br>Dark Star: Singularity map /// <br>Dark Star: Singularity map
CosmicRuins = 16, COSMIC_RUINS = 16,
/// Valoran City Park /// Valoran City Park
/// <br>Star Guardian Invasion map /// <br>Star Guardian Invasion map
ValoranCityPark = 18, VALORAN_CITY_PARK = 18,
/// Substructure 43 /// Substructure 43
/// <br>PROJECT: Hunters map /// <br>PROJECT: Hunters map
Substructure43 = 19, SUBSTRUCTURE43 = 19,
/// Crash Site /// Crash Site
/// <br>Odyssey: Extraction map /// <br>Odyssey: Extraction map
CrashSite = 20, CRASH_SITE = 20,
/// Nexus Blitz /// Nexus Blitz
/// <br>Nexus Blitz map /// <br>Nexus Blitz map
NexusBlitz = 21, NEXUS_BLITZ = 21,
} }

View File

@ -1,4 +1,10 @@
//! Constant data and Enums relevant to the Riot Games API. //! Constant data and Enums relevant to the Riot Games API.
//!
//! This module uses SCREAMING_SNAKE_CASE for enum variants, as enums in this
//! crate should be considered collections of constants.
#![allow(deprecated)]
#![allow(non_camel_case_types)]
mod macro_serde_string; mod macro_serde_string;

View File

@ -5,7 +5,6 @@
// Do not directly edit! // // Do not directly edit! //
// // // //
/////////////////////////////////////////////// ///////////////////////////////////////////////
#![allow(deprecated)]
use serde_repr::{ Serialize_repr, Deserialize_repr }; use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
@ -19,276 +18,276 @@ use num_enum::{ IntoPrimitive, TryFromPrimitive };
pub enum Queue { pub enum Queue {
/// Custom games. /// Custom games.
CustomGames = 0, CUSTOM_GAMES_ = 0,
/// 5v5 Blind Pick games games on Summoner's Rift. /// 5v5 Blind Pick games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 430 /// <br>Deprecated in patch 7.19 in favor of queueId 430
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 430")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 430")]
SummonersRift5v5BlindPickGamesDeprecated = 2, SUMMONERS_RIFT_5V5_BLIND_PICK_GAMES_DEPRECATED = 2,
/// 5v5 Blind Pick games games on Summoner's Rift. /// 5v5 Blind Pick games games on Summoner's Rift.
SummonersRift5v5BlindPickGames = 430, SUMMONERS_RIFT_5V5_BLIND_PICK_GAMES = 430,
/// 5v5 Ranked Solo games games on Summoner's Rift. /// 5v5 Ranked Solo games games on Summoner's Rift.
/// <br>Deprecated in favor of queueId 420 /// <br>Deprecated in favor of queueId 420
#[deprecated(note="Deprecated in favor of queueId 420")] #[deprecated(note="Deprecated in favor of queueId 420")]
SummonersRift5v5RankedSoloGamesDeprecated = 4, SUMMONERS_RIFT_5V5_RANKED_SOLO_GAMES_DEPRECATED = 4,
/// 5v5 Ranked Solo games games on Summoner's Rift. /// 5v5 Ranked Solo games games on Summoner's Rift.
SummonersRift5v5RankedSoloGames = 420, SUMMONERS_RIFT_5V5_RANKED_SOLO_GAMES = 420,
/// 5v5 Ranked Premade games games on Summoner's Rift. /// 5v5 Ranked Premade games games on Summoner's Rift.
/// <br>Game mode deprecated /// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")] #[deprecated(note="Game mode deprecated")]
SummonersRift5v5RankedPremadeGames = 6, SUMMONERS_RIFT_5V5_RANKED_PREMADE_GAMES = 6,
/// Co-op vs AI games games on Summoner's Rift. /// Co-op vs AI games games on Summoner's Rift.
/// <br>Deprecated in favor of queueId 32 and 33 /// <br>Deprecated in favor of queueId 32 and 33
#[deprecated(note="Deprecated in favor of queueId 32 and 33")] #[deprecated(note="Deprecated in favor of queueId 32 and 33")]
SummonersRiftCoOpVsAiGames = 7, SUMMONERS_RIFT_CO_OP_VS_AI_GAMES = 7,
/// 3v3 Normal games games on Twisted Treeline. /// 3v3 Normal games games on Twisted Treeline.
/// <br>Deprecated in patch 7.19 in favor of queueId 460 /// <br>Deprecated in patch 7.19 in favor of queueId 460
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 460")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 460")]
TwistedTreeline3v3NormalGames = 8, TWISTED_TREELINE_3V3_NORMAL_GAMES = 8,
/// 3v3 Ranked Flex games games on Twisted Treeline. /// 3v3 Ranked Flex games games on Twisted Treeline.
/// <br>Deprecated in patch 7.19 in favor of queueId 470 /// <br>Deprecated in patch 7.19 in favor of queueId 470
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 470")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 470")]
TwistedTreeline3v3RankedFlexGamesDeprecated = 9, TWISTED_TREELINE_3V3_RANKED_FLEX_GAMES_DEPRECATED = 9,
/// 3v3 Ranked Flex games games on Twisted Treeline. /// 3v3 Ranked Flex games games on Twisted Treeline.
TwistedTreeline3v3RankedFlexGames = 470, TWISTED_TREELINE_3V3_RANKED_FLEX_GAMES = 470,
/// 5v5 Draft Pick games games on Summoner's Rift. /// 5v5 Draft Pick games games on Summoner's Rift.
/// <br>Deprecated in favor of queueId 400 /// <br>Deprecated in favor of queueId 400
#[deprecated(note="Deprecated in favor of queueId 400")] #[deprecated(note="Deprecated in favor of queueId 400")]
SummonersRift5v5DraftPickGamesDeprecated = 14, SUMMONERS_RIFT_5V5_DRAFT_PICK_GAMES_DEPRECATED = 14,
/// 5v5 Draft Pick games games on Summoner's Rift. /// 5v5 Draft Pick games games on Summoner's Rift.
SummonersRift5v5DraftPickGames = 400, SUMMONERS_RIFT_5V5_DRAFT_PICK_GAMES = 400,
/// 5v5 Dominion Blind Pick games games on Crystal Scar. /// 5v5 Dominion Blind Pick games games on Crystal Scar.
/// <br>Game mode deprecated /// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")] #[deprecated(note="Game mode deprecated")]
CrystalScar5v5DominionBlindPickGames = 16, CRYSTAL_SCAR_5V5_DOMINION_BLIND_PICK_GAMES = 16,
/// 5v5 Dominion Draft Pick games games on Crystal Scar. /// 5v5 Dominion Draft Pick games games on Crystal Scar.
/// <br>Game mode deprecated /// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")] #[deprecated(note="Game mode deprecated")]
CrystalScar5v5DominionDraftPickGames = 17, CRYSTAL_SCAR_5V5_DOMINION_DRAFT_PICK_GAMES = 17,
/// Dominion Co-op vs AI games games on Crystal Scar. /// Dominion Co-op vs AI games games on Crystal Scar.
/// <br>Game mode deprecated /// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")] #[deprecated(note="Game mode deprecated")]
CrystalScarDominionCoOpVsAiGames = 25, CRYSTAL_SCAR_DOMINION_CO_OP_VS_AI_GAMES = 25,
/// Co-op vs AI Intro Bot games games on Summoner's Rift. /// Co-op vs AI Intro Bot games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 830 /// <br>Deprecated in patch 7.19 in favor of queueId 830
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 830")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 830")]
SummonersRiftCoOpVsAiIntroBotGamesDeprecated = 31, SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_GAMES_DEPRECATED = 31,
/// Co-op vs. AI Intro Bot games games on Summoner's Rift. /// Co-op vs. AI Intro Bot games games on Summoner's Rift.
SummonersRiftCoOpVsAiIntroBotGames = 830, SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_GAMES = 830,
/// Co-op vs AI Beginner Bot games games on Summoner's Rift. /// Co-op vs AI Beginner Bot games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 840 /// <br>Deprecated in patch 7.19 in favor of queueId 840
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 840")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 840")]
SummonersRiftCoOpVsAiBeginnerBotGamesDeprecated = 32, SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_GAMES_DEPRECATED = 32,
/// Co-op vs. AI Beginner Bot games games on Summoner's Rift. /// Co-op vs. AI Beginner Bot games games on Summoner's Rift.
SummonersRiftCoOpVsAiBeginnerBotGames = 840, SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_GAMES = 840,
/// Co-op vs AI Intermediate Bot games games on Summoner's Rift. /// Co-op vs AI Intermediate Bot games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 850 /// <br>Deprecated in patch 7.19 in favor of queueId 850
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 850")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 850")]
SummonersRiftCoOpVsAiIntermediateBotGamesDeprecated = 33, SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_GAMES_DEPRECATED = 33,
/// Co-op vs. AI Intermediate Bot games games on Summoner's Rift. /// Co-op vs. AI Intermediate Bot games games on Summoner's Rift.
SummonersRiftCoOpVsAiIntermediateBotGames = 850, SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_GAMES = 850,
/// 3v3 Ranked Team games games on Twisted Treeline. /// 3v3 Ranked Team games games on Twisted Treeline.
/// <br>Game mode deprecated /// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")] #[deprecated(note="Game mode deprecated")]
TwistedTreeline3v3RankedTeamGames = 41, TWISTED_TREELINE_3V3_RANKED_TEAM_GAMES = 41,
/// 5v5 Ranked Team games games on Summoner's Rift. /// 5v5 Ranked Team games games on Summoner's Rift.
/// <br>Game mode deprecated /// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")] #[deprecated(note="Game mode deprecated")]
SummonersRift5v5RankedTeamGames = 42, SUMMONERS_RIFT_5V5_RANKED_TEAM_GAMES = 42,
/// Co-op vs AI games games on Twisted Treeline. /// Co-op vs AI games games on Twisted Treeline.
/// <br>Deprecated in patch 7.19 in favor of queueId 800 /// <br>Deprecated in patch 7.19 in favor of queueId 800
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 800")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 800")]
TwistedTreelineCoOpVsAiGames = 52, TWISTED_TREELINE_CO_OP_VS_AI_GAMES = 52,
/// 5v5 Team Builder games games on Summoner's Rift. /// 5v5 Team Builder games games on Summoner's Rift.
/// <br>Game mode deprecated /// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")] #[deprecated(note="Game mode deprecated")]
SummonersRift5v5TeamBuilderGames = 61, SUMMONERS_RIFT_5V5_TEAM_BUILDER_GAMES = 61,
/// 5v5 ARAM games games on Howling Abyss. /// 5v5 ARAM games games on Howling Abyss.
/// <br>Deprecated in patch 7.19 in favor of queueId 450 /// <br>Deprecated in patch 7.19 in favor of queueId 450
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 450")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 450")]
HowlingAbyss5v5AramGamesDeprecated = 65, HOWLING_ABYSS_5V5_ARAM_GAMES_DEPRECATED = 65,
/// 5v5 ARAM games games on Howling Abyss. /// 5v5 ARAM games games on Howling Abyss.
HowlingAbyss5v5AramGames = 450, HOWLING_ABYSS_5V5_ARAM_GAMES = 450,
/// ARAM Co-op vs AI games games on Howling Abyss. /// ARAM Co-op vs AI games games on Howling Abyss.
/// <br>Game mode deprecated /// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")] #[deprecated(note="Game mode deprecated")]
HowlingAbyssAramCoOpVsAiGames = 67, HOWLING_ABYSS_ARAM_CO_OP_VS_AI_GAMES = 67,
/// One for All games games on Summoner's Rift. /// One for All games games on Summoner's Rift.
/// <br>Deprecated in patch 8.6 in favor of queueId 1020 /// <br>Deprecated in patch 8.6 in favor of queueId 1020
#[deprecated(note="Deprecated in patch 8.6 in favor of queueId 1020")] #[deprecated(note="Deprecated in patch 8.6 in favor of queueId 1020")]
SummonersRiftOneForAllGamesDeprecated = 70, SUMMONERS_RIFT_ONE_FOR_ALL_GAMES_DEPRECATED = 70,
/// One for All games games on Summoner's Rift. /// One for All games games on Summoner's Rift.
SummonersRiftOneForAllGames = 1020, SUMMONERS_RIFT_ONE_FOR_ALL_GAMES = 1020,
/// 1v1 Snowdown Showdown games games on Howling Abyss. /// 1v1 Snowdown Showdown games games on Howling Abyss.
HowlingAbyss1v1SnowdownShowdownGames = 72, HOWLING_ABYSS_1V1_SNOWDOWN_SHOWDOWN_GAMES = 72,
/// 2v2 Snowdown Showdown games games on Howling Abyss. /// 2v2 Snowdown Showdown games games on Howling Abyss.
HowlingAbyss2v2SnowdownShowdownGames = 73, HOWLING_ABYSS_2V2_SNOWDOWN_SHOWDOWN_GAMES = 73,
/// 6v6 Hexakill games games on Summoner's Rift. /// 6v6 Hexakill games games on Summoner's Rift.
SummonersRift6v6HexakillGames = 75, SUMMONERS_RIFT_6V6_HEXAKILL_GAMES = 75,
/// Ultra Rapid Fire games games on Summoner's Rift. /// Ultra Rapid Fire games games on Summoner's Rift.
SummonersRiftUltraRapidFireGames = 76, SUMMONERS_RIFT_ULTRA_RAPID_FIRE_GAMES = 76,
/// One For All: Mirror Mode games games on Howling Abyss. /// One For All: Mirror Mode games games on Howling Abyss.
HowlingAbyssOneForAllMirrorModeGames = 78, HOWLING_ABYSS_ONE_FOR_ALL_MIRROR_MODE_GAMES = 78,
/// Co-op vs AI Ultra Rapid Fire games games on Summoner's Rift. /// Co-op vs AI Ultra Rapid Fire games games on Summoner's Rift.
SummonersRiftCoOpVsAiUltraRapidFireGames = 83, SUMMONERS_RIFT_CO_OP_VS_AI_ULTRA_RAPID_FIRE_GAMES = 83,
/// Doom Bots Rank 1 games games on Summoner's Rift. /// Doom Bots Rank 1 games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 950 /// <br>Deprecated in patch 7.19 in favor of queueId 950
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")]
SummonersRiftDoomBotsRank1Games = 91, SUMMONERS_RIFT_DOOM_BOTS_RANK1_GAMES = 91,
/// Doom Bots Rank 2 games games on Summoner's Rift. /// Doom Bots Rank 2 games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 950 /// <br>Deprecated in patch 7.19 in favor of queueId 950
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")]
SummonersRiftDoomBotsRank2Games = 92, SUMMONERS_RIFT_DOOM_BOTS_RANK2_GAMES = 92,
/// Doom Bots Rank 5 games games on Summoner's Rift. /// Doom Bots Rank 5 games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 950 /// <br>Deprecated in patch 7.19 in favor of queueId 950
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")]
SummonersRiftDoomBotsRank5Games = 93, SUMMONERS_RIFT_DOOM_BOTS_RANK5_GAMES = 93,
/// Ascension games games on Crystal Scar. /// Ascension games games on Crystal Scar.
/// <br>Deprecated in patch 7.19 in favor of queueId 910 /// <br>Deprecated in patch 7.19 in favor of queueId 910
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 910")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 910")]
CrystalScarAscensionGamesDeprecated = 96, CRYSTAL_SCAR_ASCENSION_GAMES_DEPRECATED = 96,
/// Ascension games games on Crystal Scar. /// Ascension games games on Crystal Scar.
CrystalScarAscensionGames = 910, CRYSTAL_SCAR_ASCENSION_GAMES = 910,
/// 6v6 Hexakill games games on Twisted Treeline. /// 6v6 Hexakill games games on Twisted Treeline.
TwistedTreeline6v6HexakillGames = 98, TWISTED_TREELINE_6V6_HEXAKILL_GAMES = 98,
/// 5v5 ARAM games games on Butcher's Bridge. /// 5v5 ARAM games games on Butcher's Bridge.
ButchersBridge5v5AramGames = 100, BUTCHERS_BRIDGE_5V5_ARAM_GAMES = 100,
/// Legend of the Poro King games games on Howling Abyss. /// Legend of the Poro King games games on Howling Abyss.
/// <br>Deprecated in patch 7.19 in favor of queueId 920 /// <br>Deprecated in patch 7.19 in favor of queueId 920
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 920")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 920")]
HowlingAbyssLegendOfThePoroKingGamesDeprecated = 300, HOWLING_ABYSS_LEGEND_OF_THE_PORO_KING_GAMES_DEPRECATED = 300,
/// Legend of the Poro King games games on Howling Abyss. /// Legend of the Poro King games games on Howling Abyss.
HowlingAbyssLegendOfThePoroKingGames = 920, HOWLING_ABYSS_LEGEND_OF_THE_PORO_KING_GAMES = 920,
/// Nemesis games games on Summoner's Rift. /// Nemesis games games on Summoner's Rift.
SummonersRiftNemesisGames = 310, SUMMONERS_RIFT_NEMESIS_GAMES = 310,
/// Black Market Brawlers games games on Summoner's Rift. /// Black Market Brawlers games games on Summoner's Rift.
SummonersRiftBlackMarketBrawlersGames = 313, SUMMONERS_RIFT_BLACK_MARKET_BRAWLERS_GAMES = 313,
/// Nexus Siege games games on Summoner's Rift. /// Nexus Siege games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 940 /// <br>Deprecated in patch 7.19 in favor of queueId 940
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 940")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 940")]
SummonersRiftNexusSiegeGamesDeprecated = 315, SUMMONERS_RIFT_NEXUS_SIEGE_GAMES_DEPRECATED = 315,
/// Nexus Siege games games on Summoner's Rift. /// Nexus Siege games games on Summoner's Rift.
SummonersRiftNexusSiegeGames = 940, SUMMONERS_RIFT_NEXUS_SIEGE_GAMES = 940,
/// Definitely Not Dominion games games on Crystal Scar. /// Definitely Not Dominion games games on Crystal Scar.
CrystalScarDefinitelyNotDominionGames = 317, CRYSTAL_SCAR_DEFINITELY_NOT_DOMINION_GAMES = 317,
/// ARURF games games on Summoner's Rift. /// ARURF games games on Summoner's Rift.
/// <br>Deprecated in patch 7.19 in favor of queueId 900 /// <br>Deprecated in patch 7.19 in favor of queueId 900
#[deprecated(note="Deprecated in patch 7.19 in favor of queueId 900")] #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 900")]
SummonersRiftArurfGames = 318, SUMMONERS_RIFT_ARURF_GAMES = 318,
/// All Random games games on Summoner's Rift. /// All Random games games on Summoner's Rift.
SummonersRiftAllRandomGames = 325, SUMMONERS_RIFT_ALL_RANDOM_GAMES = 325,
/// 5v5 Ranked Dynamic games games on Summoner's Rift. /// 5v5 Ranked Dynamic games games on Summoner's Rift.
/// <br>Game mode deprecated in patch 6.22 /// <br>Game mode deprecated in patch 6.22
#[deprecated(note="Game mode deprecated in patch 6.22")] #[deprecated(note="Game mode deprecated in patch 6.22")]
SummonersRift5v5RankedDynamicGames = 410, SUMMONERS_RIFT_5V5_RANKED_DYNAMIC_GAMES = 410,
/// 5v5 Ranked Flex games games on Summoner's Rift. /// 5v5 Ranked Flex games games on Summoner's Rift.
SummonersRift5v5RankedFlexGames = 440, SUMMONERS_RIFT_5V5_RANKED_FLEX_GAMES = 440,
/// 3v3 Blind Pick games games on Twisted Treeline. /// 3v3 Blind Pick games games on Twisted Treeline.
TwistedTreeline3v3BlindPickGames = 460, TWISTED_TREELINE_3V3_BLIND_PICK_GAMES = 460,
/// Blood Hunt Assassin games games on Summoner's Rift. /// Blood Hunt Assassin games games on Summoner's Rift.
SummonersRiftBloodHuntAssassinGames = 600, SUMMONERS_RIFT_BLOOD_HUNT_ASSASSIN_GAMES = 600,
/// Dark Star: Singularity games games on Cosmic Ruins. /// Dark Star: Singularity games games on Cosmic Ruins.
CosmicRuinsDarkStarSingularityGames = 610, COSMIC_RUINS_DARK_STAR_SINGULARITY_GAMES = 610,
/// Clash games games on Summoner's Rift. /// Clash games games on Summoner's Rift.
SummonersRiftClashGames = 700, SUMMONERS_RIFT_CLASH_GAMES = 700,
/// Co-op vs. AI Intermediate Bot games games on Twisted Treeline. /// Co-op vs. AI Intermediate Bot games games on Twisted Treeline.
TwistedTreelineCoOpVsAiIntermediateBotGames = 800, TWISTED_TREELINE_CO_OP_VS_AI_INTERMEDIATE_BOT_GAMES = 800,
/// Co-op vs. AI Intro Bot games games on Twisted Treeline. /// Co-op vs. AI Intro Bot games games on Twisted Treeline.
TwistedTreelineCoOpVsAiIntroBotGames = 810, TWISTED_TREELINE_CO_OP_VS_AI_INTRO_BOT_GAMES = 810,
/// Co-op vs. AI Beginner Bot games games on Twisted Treeline. /// Co-op vs. AI Beginner Bot games games on Twisted Treeline.
TwistedTreelineCoOpVsAiBeginnerBotGames = 820, TWISTED_TREELINE_CO_OP_VS_AI_BEGINNER_BOT_GAMES = 820,
/// URF games games on Summoner's Rift. /// URF games games on Summoner's Rift.
SummonersRiftUrfGames = 900, SUMMONERS_RIFT_URF_GAMES = 900,
/// Doom Bots Voting games games on Summoner's Rift. /// Doom Bots Voting games games on Summoner's Rift.
SummonersRiftDoomBotsVotingGames = 950, SUMMONERS_RIFT_DOOM_BOTS_VOTING_GAMES = 950,
/// Doom Bots Standard games games on Summoner's Rift. /// Doom Bots Standard games games on Summoner's Rift.
SummonersRiftDoomBotsStandardGames = 960, SUMMONERS_RIFT_DOOM_BOTS_STANDARD_GAMES = 960,
/// Star Guardian Invasion: Normal games games on Valoran City Park. /// Star Guardian Invasion: Normal games games on Valoran City Park.
ValoranCityParkStarGuardianInvasionNormalGames = 980, VALORAN_CITY_PARK_STAR_GUARDIAN_INVASION_NORMAL_GAMES = 980,
/// Star Guardian Invasion: Onslaught games games on Valoran City Park. /// Star Guardian Invasion: Onslaught games games on Valoran City Park.
ValoranCityParkStarGuardianInvasionOnslaughtGames = 990, VALORAN_CITY_PARK_STAR_GUARDIAN_INVASION_ONSLAUGHT_GAMES = 990,
/// PROJECT: Hunters games games on Overcharge. /// PROJECT: Hunters games games on Overcharge.
OverchargeProjectHuntersGames = 1000, OVERCHARGE_PROJECT_HUNTERS_GAMES = 1000,
/// Snow ARURF games games on Summoner's Rift. /// Snow ARURF games games on Summoner's Rift.
SummonersRiftSnowArurfGames = 1010, SUMMONERS_RIFT_SNOW_ARURF_GAMES = 1010,
/// Odyssey Extraction: Intro games games on Crash Site. /// Odyssey Extraction: Intro games games on Crash Site.
CrashSiteOdysseyExtractionIntroGames = 1030, CRASH_SITE_ODYSSEY_EXTRACTION_INTRO_GAMES = 1030,
/// Odyssey Extraction: Cadet games games on Crash Site. /// Odyssey Extraction: Cadet games games on Crash Site.
CrashSiteOdysseyExtractionCadetGames = 1040, CRASH_SITE_ODYSSEY_EXTRACTION_CADET_GAMES = 1040,
/// Odyssey Extraction: Crewmember games games on Crash Site. /// Odyssey Extraction: Crewmember games games on Crash Site.
CrashSiteOdysseyExtractionCrewmemberGames = 1050, CRASH_SITE_ODYSSEY_EXTRACTION_CREWMEMBER_GAMES = 1050,
/// Odyssey Extraction: Captain games games on Crash Site. /// Odyssey Extraction: Captain games games on Crash Site.
CrashSiteOdysseyExtractionCaptainGames = 1060, CRASH_SITE_ODYSSEY_EXTRACTION_CAPTAIN_GAMES = 1060,
/// Odyssey Extraction: Onslaught games games on Crash Site. /// Odyssey Extraction: Onslaught games games on Crash Site.
CrashSiteOdysseyExtractionOnslaughtGames = 1070, CRASH_SITE_ODYSSEY_EXTRACTION_ONSLAUGHT_GAMES = 1070,
/// Teamfight Tactics games games on Convergence. /// Teamfight Tactics games games on Convergence.
ConvergenceTeamfightTacticsGames = 1090, CONVERGENCE_TEAMFIGHT_TACTICS_GAMES = 1090,
/// Ranked Teamfight Tactics games games on Convergence. /// Ranked Teamfight Tactics games games on Convergence.
ConvergenceRankedTeamfightTacticsGames = 1100, CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_GAMES = 1100,
/// Nexus Blitz games games on Nexus Blitz. /// Nexus Blitz games games on Nexus Blitz.
/// <br>Deprecated in patch 9.2 /// <br>Deprecated in patch 9.2
#[deprecated(note="Deprecated in patch 9.2")] #[deprecated(note="Deprecated in patch 9.2")]
NexusBlitzNexusBlitzGames = 1200, NEXUS_BLITZ_NEXUS_BLITZ_GAMES = 1200,
} }

View File

@ -6,17 +6,13 @@ use strum_macros::{ EnumString, Display, AsRefStr };
#[derive(EnumString, Display, AsRefStr)] #[derive(EnumString, Display, AsRefStr)]
pub enum QueueType { pub enum QueueType {
// League of Legends, Summoner's Rift (5v5), Ranked Solo Queue. // League of Legends, Summoner's Rift (5v5), Ranked Solo Queue.
#[strum(to_string="RANKED_SOLO_5x5")] RANKED_SOLO_5x5,
RankedSolo5x5,
// League of Legends, Summoner's Rift (5v5), Flex Queue. // League of Legends, Summoner's Rift (5v5), Flex Queue.
#[strum(to_string="RANKED_FLEX_SR")] RANKED_FLEX_SR,
RankedFlexSr,
// League of Legends, Twisted Treeline (3v3), Flex Queue. // League of Legends, Twisted Treeline (3v3), Flex Queue.
#[strum(to_string="RANKED_FLEX_TT")] RANKED_FLEX_TT,
RankedFlexTt,
// Ranked Teamfight Tactics. // Ranked Teamfight Tactics.
#[strum(to_string="RANKED_TFT")] RANKED_TFT,
RankedTft,
} }
serde_string!(QueueType); serde_string!(QueueType);

View File

@ -16,18 +16,18 @@ use num_enum::{ IntoPrimitive, TryFromPrimitive };
#[derive(IntoPrimitive, TryFromPrimitive)] #[derive(IntoPrimitive, TryFromPrimitive)]
#[repr(u8)] #[repr(u8)]
pub enum Season { pub enum Season {
Preseason3 = 0, PRESEASON_3 = 0,
Season3 = 1, SEASON_3 = 1,
Preseason2014 = 2, PRESEASON_2014 = 2,
Season2014 = 3, SEASON_2014 = 3,
Preseason2015 = 4, PRESEASON_2015 = 4,
Season2015 = 5, SEASON_2015 = 5,
Preseason2106 = 6, PRESEASON_2106 = 6,
Season2016 = 7, SEASON_2016 = 7,
Preseason2017 = 8, PRESEASON_2017 = 8,
Season2017 = 9, SEASON_2017 = 9,
Preseason2018 = 10, PRESEASON_2018 = 10,
Season2018 = 11, SEASON_2018 = 11,
Preseason2019 = 12, PRESEASON_2019 = 12,
Season2019 = 13, SEASON_2019 = 13,
} }

View File

@ -9,7 +9,7 @@ use num_enum::{ IntoPrimitive, TryFromPrimitive };
#[repr(u8)] #[repr(u8)]
pub enum Team { pub enum Team {
/// Blue team (bottom left on Summoner's Rift). /// Blue team (bottom left on Summoner's Rift).
Blue = 100, BLUE = 100,
/// Red team (top right on Summoner's Rift). /// Red team (top right on Summoner's Rift).
Red = 200, RED = 200,
} }

View File

@ -1,5 +1,3 @@
#![allow(deprecated)]
use strum_macros::{ EnumString, Display, AsRefStr }; use strum_macros::{ EnumString, Display, AsRefStr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };

View File

@ -16,8 +16,7 @@ pub enum GameMode {
for (const { gameMode, description } of gameModes) { for (const { gameMode, description } of gameModes) {
}} }}
/// {{= description }} /// {{= description }}
#[strum(to_string="{{= gameMode }}")] {{= gameMode }},
{{= dotUtils.changeCase.pascalCase(gameMode) }},
{{ {{
} }
}} }}

View File

@ -15,8 +15,7 @@ pub enum GameType {
for (const { gametype: gameType, description } of gameTypes) { for (const { gametype: gameType, description } of gameTypes) {
}} }}
/// {{= description }} /// {{= description }}
#[strum(to_string="{{= gameType }}")] {{= gameType }},
{{= dotUtils.changeCase.pascalCase(gameType) }},
{{ {{
} }
}} }}

View File

@ -2,7 +2,7 @@
const dotUtils = require('./dotUtils.js'); const dotUtils = require('./dotUtils.js');
const maps = require('./.maps.json'); const maps = require('./.maps.json');
const groupedMaps = maps.groupBy(({ mapName }) => const groupedMaps = maps.groupBy(({ mapName }) =>
dotUtils.changeCase.pascalCase(mapName.replace(/[ ']+/, ''))); dotUtils.changeCase.constantCase(mapName.replace(/[ ']+/, '')));
}}{{= dotUtils.preamble() }} }}{{= dotUtils.preamble() }}
use serde_repr::{ Serialize_repr, Deserialize_repr }; use serde_repr::{ Serialize_repr, Deserialize_repr };
@ -23,7 +23,7 @@ pub enum Map {
for (const [ i, { mapId, mapName, notes } ] of colMaps.entries()) { for (const [ i, { mapId, mapName, notes } ] of colMaps.entries()) {
let name = groupName; let name = groupName;
if (i != colMaps.length - 1) if (i != colMaps.length - 1)
name += dotUtils.changeCase.pascalCase(notes); name += '_' + dotUtils.changeCase.constantCase(notes);
}} }}
/// {{= mapName }} /// {{= mapName }}
/// <br>{{= notes }} /// <br>{{= notes }}

View File

@ -3,12 +3,11 @@
const queues = require('./.queues.json'); const queues = require('./.queues.json');
const groupedQueues = queues.groupBy(({ map, description }) => { const groupedQueues = queues.groupBy(({ map, description }) => {
const name = dotUtils.changeCase.pascalCase((map || '').replace("'", '')) const name = dotUtils.changeCase.constantCase((map || '').replace("'", ''))
+ dotUtils.changeCase.pascalCase((description || '').replace(/\s+(?=\d)/g, '')); + '_' + dotUtils.changeCase.constantCase((description || '').replace(/\s+(?=\d)/g, ''));
return name; return name;
}); });
}}{{= dotUtils.preamble() }} }}{{= dotUtils.preamble() }}
#![allow(deprecated)]
use serde_repr::{ Serialize_repr, Deserialize_repr }; use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
@ -28,7 +27,7 @@ pub enum Queue {
for (let { queueId, map, description, notes } of colQueues) { for (let { queueId, map, description, notes } of colQueues) {
const doc = (description ? description + ' games on ' : '') + map; const doc = (description ? description + ' games on ' : '') + map;
const deprecated = (notes || '').toUpperCase().indexOf('DEPRECATED') >= 0; const deprecated = (notes || '').toUpperCase().indexOf('DEPRECATED') >= 0;
const name = groupName + ((colQueues.length > 1 && deprecated) ? 'Deprecated' : ''); const name = groupName + ((colQueues.length > 1 && deprecated) ? '_DEPRECATED' : '');
}} }}
/// {{= doc }}. /// {{= doc }}.
{{? notes }} {{? notes }}

View File

@ -15,8 +15,7 @@ use num_enum::{ IntoPrimitive, TryFromPrimitive };
pub enum Season { pub enum Season {
{{ {{
for (const { id, season } of seasons) { for (const { id, season } of seasons) {
let name = season.replace(' ', ''); const name = season.replace(' ', '_');
name = dotUtils.changeCase.pascalCase(name).padEnd(13);
}} }}
{{= name }} = {{= id }}, {{= name }} = {{= id }},
{{ {{