今日挑战互动接口
This commit is contained in:
@@ -540,6 +540,21 @@ export function parseGoodStrWithType(str: string) {
|
||||
return result
|
||||
}
|
||||
|
||||
// 根据类型解析物品 {"type":number, "hid": number, "count": number} 格式
|
||||
//type 1.英雄,2.物品
|
||||
export function parseHeroStrWithType(str: string) {
|
||||
let result = new Array<{ type: number, hid: number, count: number }>();
|
||||
if (!str) return result;
|
||||
let decodeArr = decodeArrayListStr(str);
|
||||
for (let [type, hid, count] of decodeArr) {
|
||||
if (isNaN(parseInt(type)) || isNaN(parseInt(hid)) || isNaN(parseInt(count))) {
|
||||
throw new Error('data table format wrong');
|
||||
}
|
||||
result.push({ type: parseInt(type), hid: parseInt(hid), count: parseInt(count) });
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// 数字列表
|
||||
export function parseNumberList(str: string) {
|
||||
let res = new Array<number>();
|
||||
|
||||
Reference in New Issue
Block a user