🎈 perf(clear): 格式化
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user