关卡添加消耗品结算,奇遇的坐标改为点id
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user