更新json和部分dictionary定义

This commit is contained in:
luying
2021-01-06 17:16:15 +08:00
parent 44ebf774b9
commit 514a8de340
25 changed files with 4240 additions and 28 deletions
+8 -4
View File
@@ -1,6 +1,6 @@
// 关卡表
import {decodeArrayListStr, readJsonFile} from '../util'
import { WAR_RELATE_TABLES } from '../../consts';
import { WAR_RELATE_TABLES, WAR_TYPE } from '../../consts';
export interface DicWar {
@@ -30,6 +30,7 @@ export interface DicWar {
}
export const dicWar = new Map<number, DicWar>();
export const dicWarPvp = new Array<DicWar>();
for(let filename of WAR_RELATE_TABLES) {
const str = readJsonFile(filename);
@@ -40,10 +41,13 @@ for(let filename of WAR_RELATE_TABLES) {
o.conditionReward = parseConditionReward(o.conditionReward);
o.parseRandomReward = parseRandomReward(o.parseRandomReward);
dicWar.set(o.war_id, o);
if(o.warType == WAR_TYPE.PVP) {
dicWarPvp.push(o);
}
});
}
function parseFixReward(str: string) {
function parseFixReward(str: string = '') {
let result = new Array<{id: number, count: number}>();
if(!str) return result;
let decodeArr = decodeArrayListStr(str);
@@ -56,7 +60,7 @@ function parseFixReward(str: string) {
return result
}
function parseConditionReward(str: string) {
function parseConditionReward(str: string = '') {
let result = new Array<{id: number, count: number, condition: number}>();
if(!str) return result;
let decodeArr = decodeArrayListStr(str);
@@ -69,7 +73,7 @@ function parseConditionReward(str: string) {
return result
}
function parseRandomReward(str: string) {
function parseRandomReward(str: string = '') {
let result = new Array<{id: number, count: number, frequency: number}>();
if(!str) return result;
let decodeArr = decodeArrayListStr(str);