/
Champion.cs.dt
40 lines (38 loc) · 1.1 KB
/
Champion.cs.dt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{{
const champions = require('./.champion.json')
.filter(({ id }) => id > 0)
.sort(({ name: a }, { name: b }) => a > b ? 1 : -1);
const hashFactor = 256;
const enumName = function(name) { return name.toUpperCase().replace(/[^A-Z]+/, '_'); };
const strHash = function(str) {
let h = 0;
for (let c of str)
h = hashFactor * h + c.charCodeAt(0);
return h;
};
const padId = function(id) { return ('' + id).padEnd(3); };
}}
// This file is automatically generated.
// Do not directly edit.
// Generated on {{= (new Date).toISOString() }}
using System.ComponentModel.DataAnnotations;
namespace MingweiSamuel.Camille.Enums
{
/// <summary>
/// Champion enum based on ChampionIds.
/// </summary>
#if USE_SYSTEXTJSON
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))]
#endif
public enum Champion : int
{
{{
for (let { id, name } of champions) {
}}
[Display(Description = "{{= name }}")]
{{= enumName(name).padEnd(12) }} = {{= id }},
{{
}
}}
}
}