🎈 perf(clear): 格式化

This commit is contained in:
luying
2023-07-14 13:38:07 +08:00
parent 1d02e0f62e
commit 9c10f33401
6 changed files with 1086 additions and 1086 deletions
+269 -269
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -19,14 +19,14 @@ export interface DicStone {
// 合成消耗
readonly composeMaterial: RewardInter[];
// 属性提升
readonly attribute: {id: number, num: number}[];
readonly attribute: { id: number, num: number }[];
}
export const dicStone = new Map<number, DicStone>();
export function loadStone() {
dicStone.clear();
let arr = readFileAndParse(FILENAME.DIC_STONE);
arr.forEach(o => {
@@ -38,14 +38,14 @@ export function loadStone() {
}
function parseAttr(str: string) {
let result = new Array<{id: number, num: number}>();
if(!str) return result;
let result = new Array<{ id: number, num: number }>();
if (!str) return result;
let decodeArr = decodeArrayListStr(str);
for(let [id, num] of decodeArr) {
if(isNaN(parseInt(id)) || isNaN(parseInt(num))) {
for (let [id, num] of decodeArr) {
if (isNaN(parseInt(id)) || isNaN(parseInt(num))) {
throw new Error('data table format wrong');
}
result.push({id: parseInt(id), num: parseInt(num)});
result.push({ id: parseInt(id), num: parseInt(num) });
}
return result
}