关卡添加消耗品结算,奇遇的坐标改为点id

This commit is contained in:
luying
2020-10-20 11:38:13 +08:00
parent a96c4c4182
commit 16085ca55d
13 changed files with 8230 additions and 929 deletions

View File

@@ -14,11 +14,11 @@ const moment = require('moment');
return code;
}
export function decodeStr(type, str) {
export function decodeStr(type, str, splitForm='|') {
if(str == '&'|| !str) {
return []
} else {
return str.split('|').map(cur => {
return str.split(splitForm).map(cur => {
return decodeStrSingle(type,cur);
});
};
@@ -29,7 +29,7 @@ const moment = require('moment');
return {}
} else {
let arr = str.split('&');
let result = {};
let result: any;
switch (type) {
case 'fixReward': {
let [gid, count] = arr;
@@ -61,10 +61,10 @@ const moment = require('moment');
result = { id: parseInt(id), value: parseInt(value) };
break;
}
case 'position': {
let [x, y] = arr;
if(isNaN(x) || isNaN(y)) throw new Error('data table format wrong');
result = { x: parseInt(x), y: parseInt(y) };
case 'point': {
let [x] = arr;
if(isNaN(x)) throw new Error('data table format wrong');
result = x;
break;
}
}