lol-constants 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/assets/StatRunes.d.ts +6 -6
  2. package/assets/StatRunes.js +6 -6
  3. package/assets/StatRunesV2.d.ts +17 -0
  4. package/assets/StatRunesV2.js +20 -0
  5. package/assets/scripts/Helpers/{enableSpreadValues.d.ts → enableEscapedValues.d.ts} +2 -2
  6. package/assets/scripts/Helpers/{enableSpreadValues.js → enableEscapedValues.js} +4 -4
  7. package/assets/scripts/Helpers/getExportStatement.d.ts +1 -1
  8. package/assets/scripts/Helpers/getExportStatement.js +4 -4
  9. package/assets/scripts/Helpers/writeToTmpFile.d.ts +1 -1
  10. package/assets/scripts/Helpers/writeToTmpFile.js +2 -2
  11. package/assets/scripts/generate-all.d.ts +0 -4
  12. package/assets/scripts/generate-all.js +8 -4
  13. package/assets/scripts/generate-rune-sets-by-rune-names.js +72 -47
  14. package/assets/scripts/generate-rune-sets.js +73 -81
  15. package/dist/Constants/Runes/RuneSets.d.ts +274 -10
  16. package/dist/Constants/Runes/RuneSets.js +9 -7
  17. package/dist/Constants/Runes/RuneSetsByRuneNames.d.ts +282 -18
  18. package/dist/Constants/Runes/RuneSetsByRuneNames.js +9 -7
  19. package/dist/Helpers/Runes/getRuneCategoryByRuneName.js +6 -7
  20. package/dist/Helpers/Runes/getRuneIdByName.js +2 -2
  21. package/dist/Helpers/Runes/getRuneNameById.js +2 -2
  22. package/dist/Helpers/Runes/getStatRuneIdByName.js +2 -2
  23. package/dist/Helpers/Runes/getStatRuneNameById.js +2 -2
  24. package/dist/Helpers/Runes/isDominationTreeRuneId.js +1 -1
  25. package/dist/Helpers/Runes/isInspirationTreeRuneId.js +1 -1
  26. package/dist/Helpers/Runes/isKeystoneRuneId.js +1 -1
  27. package/dist/Helpers/Runes/isPrecisionTreeRuneId.js +1 -1
  28. package/dist/Helpers/Runes/isResolveTreeRuneId.js +1 -1
  29. package/dist/Helpers/Runes/isRuneId.js +2 -2
  30. package/dist/Helpers/Runes/isRuneName.js +2 -2
  31. package/dist/Helpers/Runes/isSorceryTreeRuneId.js +1 -1
  32. package/dist/Helpers/Runes/isStatRuneId.js +2 -2
  33. package/dist/Helpers/Runes/isStatRuneName.js +2 -2
  34. package/dist/index.d.ts +3 -6
  35. package/dist/index.js +18 -10
  36. package/dist/types/index.d.ts +14 -18
  37. package/package.json +1 -1
  38. package/dist/Constants/Runes/RuneIds.d.ts +0 -74
  39. package/dist/Constants/Runes/RuneIds.js +0 -9
  40. package/dist/Constants/Runes/RuneNames.d.ts +0 -74
  41. package/dist/Constants/Runes/RuneNames.js +0 -9
  42. package/dist/Constants/Runes/StatRuneIds.d.ts +0 -11
  43. package/dist/Constants/Runes/StatRuneIds.js +0 -4
  44. package/dist/Constants/Runes/StatRuneNames.d.ts +0 -11
  45. package/dist/Constants/Runes/StatRuneNames.js +0 -4
@@ -1,11 +1,11 @@
1
1
  export declare const StatRunes: {
2
- readonly '5001': "Defense (HP)";
3
- readonly '5002': "Defense (AR)";
4
- readonly '5003': "Defense (MR)";
5
- readonly '5002f': "Flex (AR)";
6
- readonly '5003f': "Flex (MR)";
7
- readonly '5008f': "Flex (AF)";
8
2
  readonly '5005': "Offense (AS)";
9
3
  readonly '5007': "Offense (AH)";
10
4
  readonly '5008': "Offense (AF)";
5
+ readonly '5002f': "Flex (AR)";
6
+ readonly '5003f': "Flex (MR)";
7
+ readonly '5008f': "Flex (AF)";
8
+ readonly '5001': "Defense (HP)";
9
+ readonly '5002': "Defense (AR)";
10
+ readonly '5003': "Defense (MR)";
11
11
  };
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatRunes = void 0;
4
4
  exports.StatRunes = {
5
- '5001': 'Defense (HP)',
6
- '5002': 'Defense (AR)',
7
- '5003': 'Defense (MR)',
8
- '5002f': 'Flex (AR)',
9
- '5003f': 'Flex (MR)',
10
- '5008f': 'Flex (AF)',
11
5
  '5005': 'Offense (AS)',
12
6
  '5007': 'Offense (AH)',
13
7
  '5008': 'Offense (AF)',
8
+ '5002f': 'Flex (AR)',
9
+ '5003f': 'Flex (MR)',
10
+ '5008f': 'Flex (AF)',
11
+ '5001': 'Defense (HP)',
12
+ '5002': 'Defense (AR)',
13
+ '5003': 'Defense (MR)',
14
14
  };
@@ -0,0 +1,17 @@
1
+ export declare const StatRunesV2: {
2
+ readonly 0: {
3
+ readonly '5005': "Offense (AS)";
4
+ readonly '5007': "Offense (AH)";
5
+ readonly '5008': "Offense (AF)";
6
+ };
7
+ readonly 1: {
8
+ readonly '5002f': "Flex (AR)";
9
+ readonly '5003f': "Flex (MR)";
10
+ readonly '5008f': "Flex (AF)";
11
+ };
12
+ readonly 2: {
13
+ readonly '5001': "Defense (HP)";
14
+ readonly '5002': "Defense (AR)";
15
+ readonly '5003': "Defense (MR)";
16
+ };
17
+ };
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatRunesV2 = void 0;
4
+ exports.StatRunesV2 = {
5
+ 0: {
6
+ '5005': 'Offense (AS)',
7
+ '5007': 'Offense (AH)',
8
+ '5008': 'Offense (AF)',
9
+ },
10
+ 1: {
11
+ '5002f': 'Flex (AR)',
12
+ '5003f': 'Flex (MR)',
13
+ '5008f': 'Flex (AF)',
14
+ },
15
+ 2: {
16
+ '5001': 'Defense (HP)',
17
+ '5002': 'Defense (AR)',
18
+ '5003': 'Defense (MR)',
19
+ },
20
+ };
@@ -10,6 +10,6 @@
10
10
  * Example:
11
11
  * `{"key":"...ConstantValue"} => {...ConstantValue}`
12
12
  */
13
- export declare function enableSpreadValues(obj: {
13
+ export declare function enableEscapedValues(obj: {
14
14
  [k: string]: any;
15
- }, keysToSpread: (string | number)[]): string;
15
+ }, keysToEscape: (string | number)[]): string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enableSpreadValues = void 0;
3
+ exports.enableEscapedValues = void 0;
4
4
  /**
5
5
  * Basically a modified `JSON.stringify()` function.
6
6
  *
@@ -13,9 +13,9 @@ exports.enableSpreadValues = void 0;
13
13
  * Example:
14
14
  * `{"key":"...ConstantValue"} => {...ConstantValue}`
15
15
  */
16
- function enableSpreadValues(obj, keysToSpread) {
16
+ function enableEscapedValues(obj, keysToEscape) {
17
17
  let json = JSON.stringify(obj);
18
- for (let key of keysToSpread) {
18
+ for (let key of keysToEscape) {
19
19
  const stringifiedKey = `"${key}":`;
20
20
  let stKeyIdx = json.indexOf(stringifiedKey);
21
21
  // Skip if for whatever reason not found
@@ -35,4 +35,4 @@ function enableSpreadValues(obj, keysToSpread) {
35
35
  }
36
36
  return json;
37
37
  }
38
- exports.enableSpreadValues = enableSpreadValues;
38
+ exports.enableEscapedValues = enableEscapedValues;
@@ -3,4 +3,4 @@
3
3
  */
4
4
  export declare function getExportStatement(constName: string, json: {
5
5
  [k: string]: any;
6
- }, keysToSpread?: (string | number)[], comment?: string): string;
6
+ }, keysToEscape?: (string | number)[], comment?: string): string;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExportStatement = void 0;
4
- const enableSpreadValues_1 = require("./enableSpreadValues");
4
+ const enableEscapedValues_1 = require("./enableEscapedValues");
5
5
  const getFmtdComment_1 = require("./getFmtdComment");
6
6
  /**
7
7
  * Wraps the provided JSON in a TS export-as-const statement.
8
8
  */
9
- function getExportStatement(constName, json, keysToSpread, comment) {
10
- const stringifiedJson = keysToSpread
11
- ? (0, enableSpreadValues_1.enableSpreadValues)(json, keysToSpread)
9
+ function getExportStatement(constName, json, keysToEscape, comment) {
10
+ const stringifiedJson = keysToEscape
11
+ ? (0, enableEscapedValues_1.enableEscapedValues)(json, keysToEscape)
12
12
  : JSON.stringify(json);
13
13
  const fmtdComment = comment ? (0, getFmtdComment_1.getFmtdComment)(comment) : '';
14
14
  return fmtdComment + `export const ${constName} = ${stringifiedJson} as const`;
@@ -4,5 +4,5 @@ export declare function writeToTmpFile(mainConstName: string, ...constants: {
4
4
  json: {
5
5
  [k: string]: any;
6
6
  };
7
- keysToSpread?: (string | number)[];
7
+ keysToEscape?: (string | number)[];
8
8
  }[]): Promise<void>;
@@ -5,8 +5,8 @@ const fs_1 = require("fs");
5
5
  const getExportStatement_1 = require("./getExportStatement");
6
6
  function writeToTmpFile(mainConstName, ...constants) {
7
7
  return new Promise((res, rej) => {
8
- const exportStatements = constants.reduce((finalSt, { constName, comment, json, keysToSpread, }, i) => {
9
- let exportStatement = (0, getExportStatement_1.getExportStatement)(constName, json, keysToSpread, comment);
8
+ const exportStatements = constants.reduce((finalSt, { constName, comment, json, keysToEscape, }, i) => {
9
+ let exportStatement = (0, getExportStatement_1.getExportStatement)(constName, json, keysToEscape, comment);
10
10
  return (finalSt
11
11
  + exportStatement
12
12
  // On last statement, provide only a single empty ending line
@@ -4,8 +4,6 @@ import './generate-champion-keys';
4
4
  import './generate-champion-names';
5
5
  import './generate-item-keys';
6
6
  import './generate-item-names';
7
- import './generate-rune-ids';
8
- import './generate-rune-names';
9
7
  import './generate-rune-picking-relationships';
10
8
  import './generate-rune-sets-by-rune-names';
11
9
  import './generate-rune-sets';
@@ -13,7 +11,5 @@ import './generate-spell-ids-by-name';
13
11
  import './generate-spell-ids';
14
12
  import './generate-spell-keys';
15
13
  import './generate-spell-names';
16
- import './generate-stat-rune-ids';
17
- import './generate-stat-rune-names';
18
14
  import './generate-tree-rune-ids';
19
15
  import './generate-tree-rune-names';
@@ -6,8 +6,10 @@ require("./generate-champion-keys");
6
6
  require("./generate-champion-names");
7
7
  require("./generate-item-keys");
8
8
  require("./generate-item-names");
9
- require("./generate-rune-ids");
10
- require("./generate-rune-names");
9
+ // @deprecated
10
+ // import './generate-rune-ids'
11
+ // @deprecated
12
+ // import './generate-rune-names'
11
13
  require("./generate-rune-picking-relationships");
12
14
  require("./generate-rune-sets-by-rune-names");
13
15
  require("./generate-rune-sets");
@@ -15,7 +17,9 @@ require("./generate-spell-ids-by-name");
15
17
  require("./generate-spell-ids");
16
18
  require("./generate-spell-keys");
17
19
  require("./generate-spell-names");
18
- require("./generate-stat-rune-ids");
19
- require("./generate-stat-rune-names");
20
+ // @deprecated
21
+ // import './generate-stat-rune-ids'
22
+ // @deprecated
23
+ // import './generate-stat-rune-names'
20
24
  require("./generate-tree-rune-ids");
21
25
  require("./generate-tree-rune-names");
@@ -4,15 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const runesReforged_json_1 = __importDefault(require("../runesReforged.json"));
7
- const StatRunes_1 = require("../StatRunes");
7
+ const StatRunesV2_1 = require("../StatRunesV2");
8
8
  const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
9
9
  (async () => {
10
10
  const constant = 'RuneSetsByRuneNames';
11
11
  const runeSets = {
12
- PrimaryTrees: {},
13
- SecondaryTrees: {},
14
- Keystones: {},
15
- StatRunes: {},
12
+ PrimaryRuneTrees: {},
13
+ SecondaryRuneTrees: {},
14
+ KeystoneIds: {},
15
+ StatRuneIds: {},
16
+ RuneTreeHSets: {},
17
+ StatRuneHSets: {},
16
18
  };
17
19
  const keystoneHSetIdx = 0;
18
20
  let totalRuneAmt = 0;
@@ -23,72 +25,95 @@ const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
23
25
  for (const { runes, } of horizontalSets) {
24
26
  for (let { id, name: runeName, } of runes) {
25
27
  totalRuneAmt += 1;
26
- // Add to PrimaryTrees
27
- if (!(runeTreeName in runeSets.PrimaryTrees))
28
- runeSets.PrimaryTrees[runeTreeName] = {};
29
- runeSets.PrimaryTrees[runeTreeName][runeName] = String(id);
30
- // Add to SecondaryTrees
31
- if (!(runeTreeName in runeSets.SecondaryTrees))
32
- runeSets.SecondaryTrees[runeTreeName] = {};
28
+ // Add to PrimaryRuneTrees
29
+ if (!(runeTreeName in runeSets.PrimaryRuneTrees))
30
+ runeSets.PrimaryRuneTrees[runeTreeName] = {};
31
+ runeSets.PrimaryRuneTrees[runeTreeName][runeName] = String(id);
32
+ // Add to SecondaryRuneTrees
33
+ if (!(runeTreeName in runeSets.SecondaryRuneTrees))
34
+ runeSets.SecondaryRuneTrees[runeTreeName] = {};
33
35
  // But only if it isn't a keystone rune
34
36
  if (currentHSetIdx != keystoneHSetIdx) {
35
- runeSets.SecondaryTrees[runeTreeName][runeName] = String(id);
37
+ runeSets.SecondaryRuneTrees[runeTreeName][runeName] = String(id);
36
38
  }
37
- // Add to Keystones
39
+ // Add to KeystoneIds
38
40
  // But only if it is a keystone rune
39
41
  if (currentHSetIdx == keystoneHSetIdx) {
40
- runeSets.Keystones[runeName] = String(id);
42
+ runeSets.KeystoneIds[runeName] = String(id);
41
43
  }
44
+ // Add to RuneTreeHSets
45
+ if (!(runeTreeName in runeSets.RuneTreeHSets))
46
+ runeSets.RuneTreeHSets[runeTreeName] = {};
47
+ if (!runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx])
48
+ runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx] = {};
49
+ runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx][runeName] = String(id);
42
50
  }
43
51
  ++currentHSetIdx;
44
52
  }
45
53
  }
46
- let statRuneId;
47
- for (statRuneId in StatRunes_1.StatRunes) {
48
- totalRuneAmt += 1;
49
- // Add to StatRunes
50
- runeSets.StatRunes[StatRunes_1.StatRunes[statRuneId]] = statRuneId;
54
+ for (let hSetIdx in StatRunesV2_1.StatRunesV2) {
55
+ const hSetRunes = StatRunesV2_1.StatRunesV2[hSetIdx];
56
+ for (let [statRuneId, statRuneName] of Object.entries(hSetRunes)) {
57
+ // Keep track
58
+ totalRuneAmt += 1;
59
+ // Add to StatRuneIds
60
+ runeSets.StatRuneIds[statRuneName] = statRuneId;
61
+ // Add to StatRuneHSets
62
+ if (!(hSetIdx in runeSets.StatRuneHSets))
63
+ runeSets.StatRuneHSets[hSetIdx] = {};
64
+ runeSets.StatRuneHSets[hSetIdx][statRuneName] = statRuneId;
65
+ }
51
66
  }
52
67
  // Write to file
53
68
  await (0, writeToTmpFile_1.writeToTmpFile)(constant, {
54
- constName: 'PrimaryTrees',
55
- json: runeSets.PrimaryTrees,
69
+ constName: 'PrimaryRuneTrees',
70
+ json: runeSets.PrimaryRuneTrees,
56
71
  }, {
57
- constName: 'SecondaryTrees',
58
- json: runeSets.SecondaryTrees,
72
+ constName: 'SecondaryRuneTrees',
73
+ json: runeSets.SecondaryRuneTrees,
59
74
  }, {
60
- constName: 'Keystones',
61
- json: runeSets.Keystones,
75
+ constName: 'KeystoneIds',
76
+ json: runeSets.KeystoneIds,
62
77
  }, {
63
- constName: 'StatRunes',
64
- json: runeSets.StatRunes,
78
+ constName: 'StatRuneIds',
79
+ json: runeSets.StatRuneIds,
65
80
  }, {
66
- constName: 'All',
81
+ constName: 'RuneIds',
67
82
  json: {
68
- 1: '...PrimaryTrees.Precision',
69
- 2: '...PrimaryTrees.Domination',
70
- 3: '...PrimaryTrees.Sorcery',
71
- 4: '...PrimaryTrees.Resolve',
72
- 5: '...PrimaryTrees.Inspiration',
73
- 6: '...StatRunes',
83
+ 1: '...PrimaryRuneTrees.Precision',
84
+ 2: '...PrimaryRuneTrees.Domination',
85
+ 3: '...PrimaryRuneTrees.Sorcery',
86
+ 4: '...PrimaryRuneTrees.Resolve',
87
+ 5: '...PrimaryRuneTrees.Inspiration',
88
+ 6: '...StatRuneIds',
74
89
  },
75
- keysToSpread: [1, 2, 3, 4, 5, 6],
90
+ keysToEscape: [1, 2, 3, 4, 5, 6],
91
+ }, {
92
+ constName: 'RuneTreeHSets',
93
+ json: runeSets.RuneTreeHSets,
94
+ }, {
95
+ constName: 'StatRuneHSets',
96
+ json: runeSets.StatRuneHSets,
76
97
  }, {
77
98
  constName: constant,
78
99
  comment: `Contains all Rune IDs that are known to man in the game of League of Legends. Sorted by various useful categories. There are a total of ${totalRuneAmt} runes in the game.`,
79
100
  json: {
80
- 'PrimaryTrees': 'PrimaryTrees',
81
- 'SecondaryTrees': 'SecondaryTrees',
82
- 'Keystones': 'Keystones',
83
- 'StatRunes': 'StatRunes',
84
- 'All': 'All',
101
+ 'PrimaryRuneTrees': 'PrimaryRuneTrees',
102
+ 'SecondaryRuneTrees': 'SecondaryRuneTrees',
103
+ 'KeystoneIds': 'KeystoneIds',
104
+ 'StatRuneIds': 'StatRuneIds',
105
+ 'RuneIds': 'RuneIds',
106
+ 'RuneTreeHSets': 'RuneTreeHSets',
107
+ 'StatRuneHSets': 'StatRuneHSets',
85
108
  },
86
- keysToSpread: [
87
- 'PrimaryTrees',
88
- 'SecondaryTrees',
89
- 'Keystones',
90
- 'StatRunes',
91
- 'All',
109
+ keysToEscape: [
110
+ 'PrimaryRuneTrees',
111
+ 'SecondaryRuneTrees',
112
+ 'KeystoneIds',
113
+ 'StatRuneIds',
114
+ 'RuneIds',
115
+ 'RuneTreeHSets',
116
+ 'StatRuneHSets',
92
117
  ],
93
118
  });
94
119
  })();
@@ -4,18 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const runesReforged_json_1 = __importDefault(require("../runesReforged.json"));
7
- const StatRunes_1 = require("../StatRunes");
7
+ const StatRunesV2_1 = require("../StatRunesV2");
8
8
  const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
9
9
  (async () => {
10
10
  const constant = 'RuneSets';
11
11
  const runeSets = {
12
- PrimaryTrees: {},
13
- SecondaryTrees: {},
14
- Keystones: {},
15
- StatRunes: {},
16
- // No HSets for now
17
- // RunesByHSet: {},
18
- // StatRunesByHSet: [],
12
+ PrimaryRuneTrees: {},
13
+ SecondaryRuneTrees: {},
14
+ KeystoneNames: {},
15
+ StatRuneNames: {},
16
+ RuneTreeHSets: {},
17
+ StatRuneHSets: {},
19
18
  };
20
19
  const keystoneHSetIdx = 0;
21
20
  let totalRuneAmt = 0;
@@ -26,102 +25,95 @@ const writeToTmpFile_1 = require("./Helpers/writeToTmpFile");
26
25
  for (const { runes, } of horizontalSets) {
27
26
  for (let { id, name: runeName, } of runes) {
28
27
  totalRuneAmt += 1;
29
- // Add to PrimaryTrees
30
- if (!(runeTreeName in runeSets.PrimaryTrees))
31
- runeSets.PrimaryTrees[runeTreeName] = {};
32
- runeSets.PrimaryTrees[runeTreeName][id] = runeName;
33
- // Add to SecondaryTrees
34
- if (!(runeTreeName in runeSets.SecondaryTrees))
35
- runeSets.SecondaryTrees[runeTreeName] = {};
28
+ // Add to PrimaryRuneTrees
29
+ if (!(runeTreeName in runeSets.PrimaryRuneTrees))
30
+ runeSets.PrimaryRuneTrees[runeTreeName] = {};
31
+ runeSets.PrimaryRuneTrees[runeTreeName][id] = runeName;
32
+ // Add to SecondaryRuneTrees
33
+ if (!(runeTreeName in runeSets.SecondaryRuneTrees))
34
+ runeSets.SecondaryRuneTrees[runeTreeName] = {};
36
35
  // But only if it isn't a keystone rune
37
36
  if (currentHSetIdx != keystoneHSetIdx) {
38
- runeSets.SecondaryTrees[runeTreeName][id] = runeName;
37
+ runeSets.SecondaryRuneTrees[runeTreeName][id] = runeName;
39
38
  }
40
- // Add to Keystones
39
+ // Add to KeystoneNames
41
40
  // But only if it is a keystone rune
42
41
  if (currentHSetIdx == keystoneHSetIdx) {
43
- runeSets.Keystones[id] = runeName;
42
+ runeSets.KeystoneNames[id] = runeName;
44
43
  }
45
- // No HSets for now
46
- // Add to RunesByHSet
47
- // if (!(runeTreeName in runeSets.RunesByHSet)) runeSets.RunesByHSet[runeTreeName] = []
48
- // if (!runeSets.RunesByHSet[runeTreeName]![currentHSetIdx]) runeSets.RunesByHSet[runeTreeName]![currentHSetIdx] = {}
49
- // runeSets.RunesByHSet[runeTreeName]![currentHSetIdx]![id] = runeName
44
+ // Add to RuneTreeHSets
45
+ if (!(runeTreeName in runeSets.RuneTreeHSets))
46
+ runeSets.RuneTreeHSets[runeTreeName] = {};
47
+ if (!runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx])
48
+ runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx] = {};
49
+ runeSets.RuneTreeHSets[runeTreeName][currentHSetIdx][id] = runeName;
50
50
  }
51
51
  ++currentHSetIdx;
52
52
  }
53
53
  }
54
- // No HSets for now
55
- // let currentRuneIdx = 0
56
- // let currentHSetIdx = 0
57
- let statRuneId;
58
- for (statRuneId in StatRunes_1.StatRunes) {
59
- totalRuneAmt += 1;
60
- // Add to StatRunes
61
- runeSets.StatRunes[statRuneId] = StatRunes_1.StatRunes[statRuneId];
62
- // No HSets for now
63
- // // Add to StatRunesByHSet
64
- // if (!runeSets.StatRunesByHSet[currentHSetIdx]) runeSets.StatRunesByHSet[currentHSetIdx] = {}
65
- // runeSets.StatRunesByHSet[currentHSetIdx]![statRuneId] = StatRunes[ statRuneId ]
66
- // ++currentRuneIdx
67
- // if (currentRuneIdx % 3 == 0) ++currentHSetIdx
54
+ for (let hSetIdx in StatRunesV2_1.StatRunesV2) {
55
+ const hSetRunes = StatRunesV2_1.StatRunesV2[hSetIdx];
56
+ for (let [statRuneId, statRuneName] of Object.entries(hSetRunes)) {
57
+ // Keep track
58
+ totalRuneAmt += 1;
59
+ // Add to StatRuneNames
60
+ runeSets.StatRuneNames[statRuneId] = statRuneName;
61
+ // Add to StatRuneHSets
62
+ if (!(hSetIdx in runeSets.StatRuneHSets))
63
+ runeSets.StatRuneHSets[hSetIdx] = {};
64
+ runeSets.StatRuneHSets[hSetIdx][statRuneId] = statRuneName;
65
+ }
68
66
  }
69
67
  // Write to file
70
68
  await (0, writeToTmpFile_1.writeToTmpFile)(constant, {
71
- constName: 'PrimaryTrees',
72
- json: runeSets.PrimaryTrees,
69
+ constName: 'PrimaryRuneTrees',
70
+ json: runeSets.PrimaryRuneTrees,
73
71
  }, {
74
- constName: 'SecondaryTrees',
75
- json: runeSets.SecondaryTrees,
72
+ constName: 'SecondaryRuneTrees',
73
+ json: runeSets.SecondaryRuneTrees,
76
74
  }, {
77
- constName: 'Keystones',
78
- json: runeSets.Keystones,
75
+ constName: 'KeystoneNames',
76
+ json: runeSets.KeystoneNames,
79
77
  }, {
80
- constName: 'StatRunes',
81
- json: runeSets.StatRunes,
78
+ constName: 'StatRuneNames',
79
+ json: runeSets.StatRuneNames,
82
80
  }, {
83
- constName: 'All',
81
+ constName: 'RuneNames',
84
82
  json: {
85
- 1: '...PrimaryTrees.Precision',
86
- 2: '...PrimaryTrees.Domination',
87
- 3: '...PrimaryTrees.Sorcery',
88
- 4: '...PrimaryTrees.Resolve',
89
- 5: '...PrimaryTrees.Inspiration',
90
- 6: '...StatRunes',
83
+ 1: '...PrimaryRuneTrees.Precision',
84
+ 2: '...PrimaryRuneTrees.Domination',
85
+ 3: '...PrimaryRuneTrees.Sorcery',
86
+ 4: '...PrimaryRuneTrees.Resolve',
87
+ 5: '...PrimaryRuneTrees.Inspiration',
88
+ 6: '...StatRuneNames',
91
89
  },
92
- keysToSpread: [1, 2, 3, 4, 5, 6],
93
- },
94
- // No HSets for now
95
- // {
96
- // constName: 'RunesByHSet',
97
- // json: runeSets.RunesByHSet,
98
- // },
99
- // {
100
- // constName: 'StatRunesByHSet',
101
- // json: runeSets.StatRunesByHSet,
102
- // },
103
- {
90
+ keysToEscape: [1, 2, 3, 4, 5, 6],
91
+ }, {
92
+ constName: 'RuneTreeHSets',
93
+ json: runeSets.RuneTreeHSets,
94
+ }, {
95
+ constName: 'StatRuneHSets',
96
+ json: runeSets.StatRuneHSets,
97
+ }, {
104
98
  constName: constant,
105
99
  comment: `Contains all Rune IDs that are known to man in the game of League of Legends. Sorted by various useful categories. There are a total of ${totalRuneAmt} runes in the game.`,
106
100
  json: {
107
- 'PrimaryTrees': 'PrimaryTrees',
108
- 'SecondaryTrees': 'SecondaryTrees',
109
- 'Keystones': 'Keystones',
110
- 'StatRunes': 'StatRunes',
111
- 'All': 'All',
112
- // No HSets for now
113
- // 'RunesByHSet': 'RunesByHSet',
114
- // 'StatRunesByHSet': 'StatRunesByHSet',
101
+ 'PrimaryRuneTrees': 'PrimaryRuneTrees',
102
+ 'SecondaryRuneTrees': 'SecondaryRuneTrees',
103
+ 'KeystoneNames': 'KeystoneNames',
104
+ 'StatRuneNames': 'StatRuneNames',
105
+ 'RuneNames': 'RuneNames',
106
+ 'RuneTreeHSets': 'RuneTreeHSets',
107
+ 'StatRuneHSets': 'StatRuneHSets',
115
108
  },
116
- keysToSpread: [
117
- 'PrimaryTrees',
118
- 'SecondaryTrees',
119
- 'Keystones',
120
- 'StatRunes',
121
- 'All',
122
- // No HSets for now
123
- // 'RunesByHSet',
124
- // 'StatRunesByHSet',
109
+ keysToEscape: [
110
+ 'PrimaryRuneTrees',
111
+ 'SecondaryRuneTrees',
112
+ 'KeystoneNames',
113
+ 'StatRuneNames',
114
+ 'RuneNames',
115
+ 'RuneTreeHSets',
116
+ 'StatRuneHSets',
125
117
  ],
126
118
  });
127
119
  })();