mirror of https://github.com/MingweiSamuel/Riven
adding game_type, removing unneccesary std::fmt::Debug imports
parent
561eb04c48
commit
adec5f0df8
|
@ -8,7 +8,7 @@ use num_derive;
|
|||
///
|
||||
/// The documentation of each variant specifies:<br>
|
||||
/// NAME (`IDENTIFIER`, ID).
|
||||
#[derive(fmt::Debug, Copy, Clone)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive)]
|
||||
pub enum Champion {
|
||||
/** Aatrox (`Aatrox`, 266). */ Aatrox = 266,
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#![allow(deprecated)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use strum_macros::{ EnumString, Display, AsRefStr };
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
@ -13,7 +11,6 @@ pub enum Division {
|
|||
II = 2,
|
||||
III = 3,
|
||||
IV = 4,
|
||||
|
||||
#[deprecated(note="Removed for 2019.")]
|
||||
V = 5,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
// This file is automatically generated.
|
||||
// Do not directly edit.
|
||||
|
||||
use strum_macros::{ EnumString, Display, AsRefStr };
|
||||
|
||||
/// League of Legends game type: matched game, custom game, or tutorial game.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(EnumString, Display, AsRefStr)]
|
||||
#[repr(u8)]
|
||||
pub enum GameType {
|
||||
/// Custom games
|
||||
#[strum(to_string="CUSTOM_GAME")]
|
||||
CustomGame,
|
||||
/// Tutorial games
|
||||
#[strum(to_string="TUTORIAL_GAME")]
|
||||
TutorialGame,
|
||||
/// all other games
|
||||
#[strum(to_string="MATCHED_GAME")]
|
||||
MatchedGame,
|
||||
}
|
|
@ -6,6 +6,9 @@ pub use champion::*;
|
|||
mod division;
|
||||
pub use division::*;
|
||||
|
||||
mod game_type;
|
||||
pub use game_type::*;
|
||||
|
||||
mod queue_type;
|
||||
pub use queue_type::*;
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
use std::fmt::Debug;
|
||||
|
||||
use strum_macros::{ EnumString, Display, AsRefStr };
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#![allow(deprecated)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use strum_macros::{ EnumString, Display, AsRefStr };
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
|
@ -20,7 +20,7 @@ use num_derive;
|
|||
///
|
||||
/// The documentation of each variant specifies:<br>
|
||||
/// NAME (`IDENTIFIER`, ID).
|
||||
#[derive(fmt::Debug, Copy, Clone)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive)]
|
||||
pub enum Champion {
|
||||
{{
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
{{
|
||||
const dotUtils = require('./dotUtils.js');
|
||||
const gameTypes = require('./.gameTypes.json');
|
||||
}}{{= dotUtils.preamble() }}
|
||||
|
||||
use strum_macros::{ EnumString, Display, AsRefStr };
|
||||
|
||||
/// League of Legends game type: matched game, custom game, or tutorial game.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(EnumString, Display, AsRefStr)]
|
||||
#[repr(u8)]
|
||||
pub enum GameType {
|
||||
{{
|
||||
for (const { gametype: gameType, description } of gameTypes) {
|
||||
}}
|
||||
/// {{= description }}
|
||||
#[strum(to_string="{{= gameType }}")]
|
||||
{{= dotUtils.changeCase.pascalCase(gameType) }},
|
||||
{{
|
||||
}
|
||||
}}
|
||||
}
|
|
@ -22,6 +22,10 @@ const files = [
|
|||
[
|
||||
'http://static.developer.riotgames.com/docs/lol/queues.json',
|
||||
'.queues.json'
|
||||
],
|
||||
[
|
||||
'http://static.developer.riotgames.com/docs/lol/gameTypes.json',
|
||||
'.gameTypes.json'
|
||||
]
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue