Riven/srcgen/consts/queue.rs.dt

36 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-10-23 08:20:34 +00:00
{{
const dotUtils = require('./dotUtils.js');
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, ''));
return name;
});
}}{{= dotUtils.preamble() }}
/// League of Legends matchmaking queue.
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-25 16:52:55 +00:00
const name = groupName + ((colQueues.length > 1 && deprecated) ? 'Deprecated' : '');
2019-10-23 08:20:34 +00:00
}}
/// {{= doc }}.
{{? notes }}
2019-10-23 08:24:15 +00:00
/// <br>{{= notes }}
2019-10-23 08:20:34 +00:00
{{?}}
{{? deprecated}}
#[deprecated(note="{{= notes }}")]
{{?}}
{{= name }} = {{= queueId }},
{{
}
}
}}
}