diff --git a/public/data/elfs/be.json b/public/data/elfs/be.json index dada7336..3017cbda 100644 --- a/public/data/elfs/be.json +++ b/public/data/elfs/be.json @@ -80,5 +80,6 @@ "requiredRank": 3 } ] - ] + ], + "version": 3.0 } diff --git a/public/data/elfs/bella.json b/public/data/elfs/bella.json index be0514e3..7f30f8eb 100644 --- a/public/data/elfs/bella.json +++ b/public/data/elfs/bella.json @@ -102,5 +102,6 @@ "requiredRank": 3 } ] - ] + ], + "version": 4.1 } diff --git a/public/data/elfs/bof.json b/public/data/elfs/bof.json index d34e6d44..fd0ec747 100644 --- a/public/data/elfs/bof.json +++ b/public/data/elfs/bof.json @@ -96,5 +96,6 @@ "requiredRank": 3 } ] - ] + ], + "version": 3.7 } diff --git a/public/data/elfs/jw.json b/public/data/elfs/jw.json index 92d95f37..85d7826c 100644 --- a/public/data/elfs/jw.json +++ b/public/data/elfs/jw.json @@ -61,5 +61,6 @@ "requiredRank": 3 } ] - ] + ], + "version": 3.0 } diff --git a/public/data/elfs/kl.json b/public/data/elfs/kl.json index cf39486c..47f95c93 100644 --- a/public/data/elfs/kl.json +++ b/public/data/elfs/kl.json @@ -108,5 +108,6 @@ "requiredRank": 4 } ] - ] + ], + "version": 5.2 } diff --git a/public/data/elfs/se.json b/public/data/elfs/se.json index dff3d935..95f2175a 100644 --- a/public/data/elfs/se.json +++ b/public/data/elfs/se.json @@ -98,5 +98,6 @@ "requiredRank": 3 } ] - ] + ], + "version": 3.2 } diff --git a/public/data/elfs/sr.json b/public/data/elfs/sr.json index fa1a3d4a..ea40d358 100644 --- a/public/data/elfs/sr.json +++ b/public/data/elfs/sr.json @@ -104,5 +104,6 @@ "requiredRank": 3 } ] - ] + ], + "version": 5.0 } diff --git a/public/data/elfs/tz.json b/public/data/elfs/tz.json index 795cfa00..f83ae900 100644 --- a/public/data/elfs/tz.json +++ b/public/data/elfs/tz.json @@ -97,5 +97,6 @@ "requiredRank": 3 } ] - ] + ], + "version": 4.3 } diff --git a/public/data/elfs/we.json b/public/data/elfs/we.json index b8f0b80b..db646247 100644 --- a/public/data/elfs/we.json +++ b/public/data/elfs/we.json @@ -90,5 +90,6 @@ "requiredRank": 3 } ] - ] + ], + "version": 4.6 } diff --git a/src/data/honkai3rd/elfs.ts b/src/data/honkai3rd/elfs.ts index 3bbc2ffc..60d46287 100644 --- a/src/data/honkai3rd/elfs.ts +++ b/src/data/honkai3rd/elfs.ts @@ -13,6 +13,7 @@ export interface ElfData { baseRank: number strengths: string[] skillRows: [ElfSkill[], ElfSkill[], ElfSkill[], ElfSkill[]] + version: number } const elfFileNameList = readdirSync('elfs') @@ -24,15 +25,22 @@ const elfDataList = elfFileNameList return data }) .sort((a, b) => { - let compareResult = a.name + let compareResult = 0 + + compareResult = -a.version + b.version + + if (compareResult !== 0) { + return compareResult + } + compareResult = a.name .replace(/ \(.\)/, '') .localeCompare(b.name.replace(/ \(.\)/, '')) return compareResult }) -const elfMap = elfDataList.reduce((map, stigmata) => { - map.set(stigmata.id, stigmata) +const elfMap = elfDataList.reduce((map, elf) => { + map.set(elf.id, elf) return map }, new Map())