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 serde_repr::{ Serialize_repr, Deserialize_repr };
/// League of Legends champions.
/// League of Legend's champions.
///
/// The documentation of each variant specifies:<br>
/// NAME (`IDENTIFIER`, ID).

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,6 @@
// Do not directly edit! //
// //
///////////////////////////////////////////////
#![allow(deprecated)]
use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive };
@ -19,276 +18,276 @@ use num_enum::{ IntoPrimitive, TryFromPrimitive };
pub enum Queue {
/// Custom games.
CustomGames = 0,
CUSTOM_GAMES_ = 0,
/// 5v5 Blind Pick games games on Summoner's Rift.
/// <br>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.
SummonersRift5v5BlindPickGames = 430,
SUMMONERS_RIFT_5V5_BLIND_PICK_GAMES = 430,
/// 5v5 Ranked Solo games games on Summoner's Rift.
/// <br>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.
SummonersRift5v5RankedSoloGames = 420,
SUMMONERS_RIFT_5V5_RANKED_SOLO_GAMES = 420,
/// 5v5 Ranked Premade games games on Summoner's Rift.
/// <br>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.
/// <br>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.
/// <br>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.
/// <br>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.
TwistedTreeline3v3RankedFlexGames = 470,
TWISTED_TREELINE_3V3_RANKED_FLEX_GAMES = 470,
/// 5v5 Draft Pick games games on Summoner's Rift.
/// <br>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.
SummonersRift5v5DraftPickGames = 400,
SUMMONERS_RIFT_5V5_DRAFT_PICK_GAMES = 400,
/// 5v5 Dominion Blind Pick games games on Crystal Scar.
/// <br>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.
/// <br>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.
/// <br>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.
/// <br>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.
SummonersRiftCoOpVsAiIntroBotGames = 830,
SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_GAMES = 830,
/// Co-op vs AI Beginner Bot games games on Summoner's Rift.
/// <br>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.
SummonersRiftCoOpVsAiBeginnerBotGames = 840,
SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_GAMES = 840,
/// Co-op vs AI Intermediate Bot games games on Summoner's Rift.
/// <br>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.
SummonersRiftCoOpVsAiIntermediateBotGames = 850,
SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_GAMES = 850,
/// 3v3 Ranked Team games games on Twisted Treeline.
/// <br>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.
/// <br>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.
/// <br>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.
/// <br>Game mode deprecated
#[deprecated(note="Game mode deprecated")]
SummonersRift5v5TeamBuilderGames = 61,
SUMMONERS_RIFT_5V5_TEAM_BUILDER_GAMES = 61,
/// 5v5 ARAM games games on Howling Abyss.
/// <br>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.
HowlingAbyss5v5AramGames = 450,
HOWLING_ABYSS_5V5_ARAM_GAMES = 450,
/// ARAM Co-op vs AI games games on Howling Abyss.
/// <br>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.
/// <br>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.
SummonersRiftOneForAllGames = 1020,
SUMMONERS_RIFT_ONE_FOR_ALL_GAMES = 1020,
/// 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.
HowlingAbyss2v2SnowdownShowdownGames = 73,
HOWLING_ABYSS_2V2_SNOWDOWN_SHOWDOWN_GAMES = 73,
/// 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.
SummonersRiftUltraRapidFireGames = 76,
SUMMONERS_RIFT_ULTRA_RAPID_FIRE_GAMES = 76,
/// 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.
SummonersRiftCoOpVsAiUltraRapidFireGames = 83,
SUMMONERS_RIFT_CO_OP_VS_AI_ULTRA_RAPID_FIRE_GAMES = 83,
/// Doom Bots Rank 1 games games on Summoner's Rift.
/// <br>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.
/// <br>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.
/// <br>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.
/// <br>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.
CrystalScarAscensionGames = 910,
CRYSTAL_SCAR_ASCENSION_GAMES = 910,
/// 6v6 Hexakill games games on Twisted Treeline.
TwistedTreeline6v6HexakillGames = 98,
TWISTED_TREELINE_6V6_HEXAKILL_GAMES = 98,
/// 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.
/// <br>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.
HowlingAbyssLegendOfThePoroKingGames = 920,
HOWLING_ABYSS_LEGEND_OF_THE_PORO_KING_GAMES = 920,
/// Nemesis games games on Summoner's Rift.
SummonersRiftNemesisGames = 310,
SUMMONERS_RIFT_NEMESIS_GAMES = 310,
/// 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.
/// <br>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.
SummonersRiftNexusSiegeGames = 940,
SUMMONERS_RIFT_NEXUS_SIEGE_GAMES = 940,
/// Definitely Not Dominion games games on Crystal Scar.
CrystalScarDefinitelyNotDominionGames = 317,
CRYSTAL_SCAR_DEFINITELY_NOT_DOMINION_GAMES = 317,
/// ARURF games games on Summoner's Rift.
/// <br>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.
SummonersRiftAllRandomGames = 325,
SUMMONERS_RIFT_ALL_RANDOM_GAMES = 325,
/// 5v5 Ranked Dynamic games games on Summoner's Rift.
/// <br>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.
SummonersRift5v5RankedFlexGames = 440,
SUMMONERS_RIFT_5V5_RANKED_FLEX_GAMES = 440,
/// 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.
SummonersRiftBloodHuntAssassinGames = 600,
SUMMONERS_RIFT_BLOOD_HUNT_ASSASSIN_GAMES = 600,
/// Dark Star: Singularity games games on Cosmic Ruins.
CosmicRuinsDarkStarSingularityGames = 610,
COSMIC_RUINS_DARK_STAR_SINGULARITY_GAMES = 610,
/// 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.
TwistedTreelineCoOpVsAiIntermediateBotGames = 800,
TWISTED_TREELINE_CO_OP_VS_AI_INTERMEDIATE_BOT_GAMES = 800,
/// 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.
TwistedTreelineCoOpVsAiBeginnerBotGames = 820,
TWISTED_TREELINE_CO_OP_VS_AI_BEGINNER_BOT_GAMES = 820,
/// URF games games on Summoner's Rift.
SummonersRiftUrfGames = 900,
SUMMONERS_RIFT_URF_GAMES = 900,
/// 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.
SummonersRiftDoomBotsStandardGames = 960,
SUMMONERS_RIFT_DOOM_BOTS_STANDARD_GAMES = 960,
/// 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.
ValoranCityParkStarGuardianInvasionOnslaughtGames = 990,
VALORAN_CITY_PARK_STAR_GUARDIAN_INVASION_ONSLAUGHT_GAMES = 990,
/// PROJECT: Hunters games games on Overcharge.
OverchargeProjectHuntersGames = 1000,
OVERCHARGE_PROJECT_HUNTERS_GAMES = 1000,
/// Snow ARURF games games on Summoner's Rift.
SummonersRiftSnowArurfGames = 1010,
SUMMONERS_RIFT_SNOW_ARURF_GAMES = 1010,
/// 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.
CrashSiteOdysseyExtractionCadetGames = 1040,
CRASH_SITE_ODYSSEY_EXTRACTION_CADET_GAMES = 1040,
/// 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.
CrashSiteOdysseyExtractionCaptainGames = 1060,
CRASH_SITE_ODYSSEY_EXTRACTION_CAPTAIN_GAMES = 1060,
/// Odyssey Extraction: Onslaught games games on Crash Site.
CrashSiteOdysseyExtractionOnslaughtGames = 1070,
CRASH_SITE_ODYSSEY_EXTRACTION_ONSLAUGHT_GAMES = 1070,
/// Teamfight Tactics games games on Convergence.
ConvergenceTeamfightTacticsGames = 1090,
CONVERGENCE_TEAMFIGHT_TACTICS_GAMES = 1090,
/// Ranked Teamfight Tactics games games on Convergence.
ConvergenceRankedTeamfightTacticsGames = 1100,
CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_GAMES = 1100,
/// Nexus Blitz games games on Nexus Blitz.
/// <br>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)]
pub enum QueueType {
// League of Legends, Summoner's Rift (5v5), Ranked Solo Queue.
#[strum(to_string="RANKED_SOLO_5x5")]
RankedSolo5x5,
RANKED_SOLO_5x5,
// League of Legends, Summoner's Rift (5v5), Flex Queue.
#[strum(to_string="RANKED_FLEX_SR")]
RankedFlexSr,
RANKED_FLEX_SR,
// League of Legends, Twisted Treeline (3v3), Flex Queue.
#[strum(to_string="RANKED_FLEX_TT")]
RankedFlexTt,
RANKED_FLEX_TT,
// Ranked Teamfight Tactics.
#[strum(to_string="RANKED_TFT")]
RankedTft,
RANKED_TFT,
}
serde_string!(QueueType);

View File

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

View File

@ -9,7 +9,7 @@ use num_enum::{ IntoPrimitive, TryFromPrimitive };
#[repr(u8)]
pub enum Team {
/// Blue team (bottom left on Summoner's Rift).
Blue = 100,
BLUE = 100,
/// 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 num_enum::{ IntoPrimitive, TryFromPrimitive };

View File

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

View File

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

View File

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

View File

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

View File

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