refactor: 重构lib代码(无实质性功能更新,可不更新)

This commit is contained in:
bietiaop 2024-08-22 13:34:08 +08:00
parent a7f06d404b
commit aa3b7928ec
26 changed files with 547 additions and 483 deletions

19
lib/gacha/tool.js Normal file
View file

@ -0,0 +1,19 @@
/**
* 欧非分析
* @param {number} ast
* @param {number[]} lst
*/
export const getLevelFromList = (ast, lst) => {
if (ast === 0) {
return 2;
}
let level = 0;
for (let numIndex = 0; numIndex < lst.length; numIndex++) {
if (ast <= lst[numIndex]) {
level = 4 - numIndex;
break;
}
}
return level;
};