mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-28 04:32:59 -08:00
9db4c1a4a5
#[non_exhaustive]
45 lines
No EOL
1.3 KiB
Text
45 lines
No EOL
1.3 KiB
Text
{{
|
|
const dotUtils = require('./dotUtils.js');
|
|
const queues = require('./.queues.json');
|
|
|
|
const groupedQueues = queues.groupBy(({ map, description }) => {
|
|
const name = dotUtils.changeCase.constantCase((map || '').replace("'", ''))
|
|
+ '_' + dotUtils.changeCase.constantCase((description || '').replace(/\s+(?=\d)/g, ''));
|
|
return name;
|
|
});
|
|
}}{{= dotUtils.preamble() }}
|
|
|
|
use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
|
|
|
/// League of Legends matchmaking queue.
|
|
#[non_exhaustive]
|
|
#[derive(Debug, Copy, Clone)]
|
|
#[derive(Eq, PartialEq)]
|
|
#[derive(Serialize_repr, Deserialize_repr)]
|
|
#[derive(IntoPrimitive, TryFromPrimitive)]
|
|
#[repr(u16)]
|
|
pub enum Queue {
|
|
{{
|
|
for (let [ groupName, colQueues ] of groupedQueues) {
|
|
}}
|
|
|
|
{{
|
|
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' : '');
|
|
}}
|
|
/// {{= doc }}.
|
|
{{? notes }}
|
|
/// <br>{{= notes }}
|
|
{{?}}
|
|
{{? deprecated}}
|
|
#[deprecated(note="{{= notes }}")]
|
|
{{?}}
|
|
{{= name }} = {{= queueId }},
|
|
{{
|
|
}
|
|
}
|
|
}}
|
|
} |