2019-10-23 01:20:34 -07:00
|
|
|
{{
|
|
|
|
const dotUtils = require('./dotUtils.js');
|
|
|
|
const queues = require('./.queues.json');
|
|
|
|
|
|
|
|
const groupedQueues = queues.groupBy(({ map, description }) => {
|
2019-10-27 01:52:55 -07:00
|
|
|
const name = dotUtils.changeCase.constantCase((map || '').replace("'", ''))
|
|
|
|
+ '_' + dotUtils.changeCase.constantCase((description || '').replace(/\s+(?=\d)/g, ''));
|
2019-10-23 01:20:34 -07:00
|
|
|
return name;
|
|
|
|
});
|
|
|
|
}}{{= dotUtils.preamble() }}
|
2019-10-25 13:37:23 -07:00
|
|
|
|
|
|
|
use serde_repr::{ Serialize_repr, Deserialize_repr };
|
2019-10-26 09:23:58 -07:00
|
|
|
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
2019-10-23 01:20:34 -07:00
|
|
|
|
|
|
|
/// League of Legends matchmaking queue.
|
2019-10-30 13:29:23 -07:00
|
|
|
#[non_exhaustive]
|
2019-10-25 13:37:23 -07:00
|
|
|
#[derive(Debug, Copy, Clone)]
|
|
|
|
#[derive(Eq, PartialEq)]
|
|
|
|
#[derive(Serialize_repr, Deserialize_repr)]
|
2019-10-26 09:23:58 -07:00
|
|
|
#[derive(IntoPrimitive, TryFromPrimitive)]
|
2019-10-25 13:37:23 -07:00
|
|
|
#[repr(u16)]
|
2019-10-23 01:20:34 -07:00
|
|
|
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;
|
2019-10-27 01:52:55 -07:00
|
|
|
const name = groupName + ((colQueues.length > 1 && deprecated) ? '_DEPRECATED' : '');
|
2019-10-23 01:20:34 -07:00
|
|
|
}}
|
|
|
|
/// {{= doc }}.
|
|
|
|
{{? notes }}
|
2019-10-23 01:24:15 -07:00
|
|
|
/// <br>{{= notes }}
|
2019-10-23 01:20:34 -07:00
|
|
|
{{?}}
|
|
|
|
{{? deprecated}}
|
|
|
|
#[deprecated(note="{{= notes }}")]
|
|
|
|
{{?}}
|
|
|
|
{{= name }} = {{= queueId }},
|
|
|
|
{{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}
|