koishi-plugin-beatsaber-bot
Version:
一个 用于 BeatSaber 的 koishi Bot 插件
29 lines (28 loc) • 662 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.sortScore = void 0;
const difficulties = {
"Easy": 0,
"Normal": 1,
"Hard": 2,
"Expert": 3,
"ExpertPlus": 4
};
const modes = {
"Legacy": 0,
"Lawless": 1,
"Lightshow": 2,
"360Degree": 3,
"90Degree": 4,
"NoArrows": 5,
"OneSaber": 6,
"Standard": 7
};
function sortScore(a, b) {
let res = modes[b.difficulty.modeName] - modes[a.difficulty.modeName];
if (res == 0) {
res = difficulties[b.difficulty.difficultyName] - difficulties[a.difficulty.difficultyName];
}
return res;
}
exports.sortScore = sortScore;