adding season enum

pull/5/head
Mingwei Samuel 2019-10-23 00:49:02 -07:00
parent 79ad933e91
commit fee229c1a9
9 changed files with 55 additions and 26 deletions

View File

@ -1,7 +1,6 @@
 // This file is automatically generated.
// This file is automatically generated. // Do not directly edit.
// Do not directly edit. // Generated on 2019-10-23T07:48:57.279Z.
// Generated on 2019-10-23T07:19:13.049Z
use std::fmt; use std::fmt;
use num_derive; use num_derive;

View File

@ -1,7 +1,10 @@
//! Constant data and Enums relevant to the Riot Games API. //! Constant data and Enums relevant to the Riot Games API.
mod region; mod region;
mod champion;
pub use region::*; pub use region::*;
mod champion;
pub use champion::*; pub use champion::*;
mod season;
pub use season::*;

21
src/consts/season.rs Normal file
View File

@ -0,0 +1,21 @@
// This file is automatically generated.
// Do not directly edit.
// Generated on 2019-10-23T07:48:57.301Z.
/// League of Legends matchmaking seasons.
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,
}

View File

@ -1,7 +1,6 @@
// This file is automatically generated.
// This file is automatically generated. // Do not directly edit.
// Do not directly edit. // Generated on 2019-10-23T07:48:57.296Z.
// Generated on 2019-10-23T07:19:13.042Z
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version 0c74167e0eaaeb6de1c7e8219fecaabcf8386d1f // Version 0c74167e0eaaeb6de1c7e8219fecaabcf8386d1f

View File

@ -1,7 +1,6 @@
// This file is automatically generated.
// This file is automatically generated. // Do not directly edit.
// Do not directly edit. // Generated on 2019-10-23T07:48:57.302Z.
// Generated on 2019-10-23T07:19:13.050Z
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version 0c74167e0eaaeb6de1c7e8219fecaabcf8386d1f // Version 0c74167e0eaaeb6de1c7e8219fecaabcf8386d1f

View File

@ -11,10 +11,7 @@
return h; return h;
}; };
const padId = function(id) { return ('' + id).padEnd(3); }; const padId = function(id) { return ('' + id).padEnd(3); };
}} }}{{= require('./dotUtils.js').preamble() }}
// This file is automatically generated.
// Do not directly edit.
// Generated on {{= (new Date).toISOString() }}
use std::fmt; use std::fmt;
use num_derive; use num_derive;

View File

@ -0,0 +1,17 @@
{{
const dotUtils = require('./dotUtils.js');
const seasons = require('./.seasons.json');
}}{{= dotUtils.preamble() }}
/// League of Legends matchmaking seasons.
pub enum Season {
{{
for (const { id, season } of seasons) {
let name = season.replace(' ', '');
name = dotUtils.changeCase.pascalCase(name).padEnd(13);
}}
{{= name }} = {{= id }},
{{
}
}}
}

View File

@ -1,10 +1,7 @@
{{ {{
const spec = require('./.spec.json'); const spec = require('./.spec.json');
const dotUtils = require('./dotUtils.js'); const dotUtils = require('./dotUtils.js');
}} }}{{= dotUtils.preamble() }}
// This file is automatically generated.
// Do not directly edit.
// Generated on {{= (new Date).toISOString() }}
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version {{= spec.info.version }} // Version {{= spec.info.version }}

View File

@ -1,10 +1,7 @@
{{ {{
const spec = require('./.spec.json'); const spec = require('./.spec.json');
const dotUtils = require('./dotUtils.js'); const dotUtils = require('./dotUtils.js');
}} }}{{= dotUtils.preamble() }}
// This file is automatically generated.
// Do not directly edit.
// Generated on {{= (new Date).toISOString() }}
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version {{= spec.info.version }} // Version {{= spec.info.version }}