json:fix数组重复加载的bug
This commit is contained in:
@@ -22,7 +22,7 @@ const DicActivityTypeKeys: KeysEnum<DicActivityType> = {
|
||||
|
||||
export const dicActivityType = new Array<DicActivityType>();
|
||||
export function loadActivityType() {
|
||||
|
||||
dicActivityType.splice(0, dicActivityType.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_ACTIVITY_TYPE);
|
||||
arr.forEach(o => {
|
||||
o.desc = o.string;
|
||||
|
||||
@@ -20,7 +20,7 @@ const DicArmyBossRankKeys: KeysEnum<DicArmyBossRank> = {
|
||||
|
||||
export const dicArmyBossRank = new Array<DicArmyBossRank>();
|
||||
export function loadArmyBossRank() {
|
||||
|
||||
dicArmyBossRank.splice(0, dicArmyBossRank.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_ARMY_BOSS_RANK_REWARD);
|
||||
arr.forEach(o => {
|
||||
o.reward = parseGoodStr(o.reward);
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface DicBlueprtPossibility {
|
||||
|
||||
export const dicBlueprtPossibility = new Array<DicBlueprtPossibility>();
|
||||
export function loadBlueprtPossibility() {
|
||||
|
||||
dicBlueprtPossibility.splice(0, dicBlueprtPossibility.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_BLUEPRT_POSSIBILITY);
|
||||
arr.forEach(o => {
|
||||
o.possibility = parsePossibility(o.possibility);
|
||||
|
||||
@@ -18,6 +18,7 @@ export interface DicDaily {
|
||||
|
||||
export const dicDaily = new Array<DicDaily>();
|
||||
export function loadDaily() {
|
||||
dicDaily.splice(0, dicDaily.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_DAILY);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -36,6 +36,7 @@ export const dicEvent = new Map<number, DicEvent>();
|
||||
export const dicEventList = new Array<DicEvent>();
|
||||
|
||||
export function loadEvent () {
|
||||
dicEventList.splice(0, dicEventList.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_EVENT);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface DicGkPvp {
|
||||
export const dicGkPvp = new Map<number, DicGkPvp>();
|
||||
export const dicGkPvps = new Array<number>();
|
||||
export function loadGkPvp() {
|
||||
dicGkPvps.splice(0, dicGkPvps.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_GK_PVP);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -18,7 +18,7 @@ export interface DicGuildActiveWeekReward {
|
||||
|
||||
export const dicGuildActiveWeekReward = new Array<DicGuildActiveWeekReward>();
|
||||
export function loadGuildActiveWeekReward() {
|
||||
|
||||
dicGuildActiveWeekReward.splice(0, dicGuildActiveWeekReward.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_ACTIVE_DAY_REWARD);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -38,6 +38,7 @@ const DicHeroKeys: KeysEnum<DicHero> = {heroId: true, name: true, quality: true,
|
||||
export const dicMyHeroes = new Array<number>();
|
||||
export const dicHero = new Map<number, DicHero>();
|
||||
export function loadHero() {
|
||||
dicMyHeroes.splice(0, dicMyHeroes.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_HERO);
|
||||
arr.forEach(o => {
|
||||
if(o.heroId > 0 && o.heroId <= 300) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface DicPvpBox {
|
||||
|
||||
export const dicPvpBoxs = new Array<DicPvpBox>();
|
||||
export function loadPvpBox() {
|
||||
|
||||
dicPvpBoxs.splice(0, dicPvpBoxs.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_PVP_BOX);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface DicHeroRewads {
|
||||
|
||||
export const dicHeroRewads = new Array<DicHeroRewads>();
|
||||
export function loadPvpHeroReward() {
|
||||
dicHeroRewads.splice(0, dicHeroRewads.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_PVP_HERO_REWARD);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -17,7 +17,7 @@ export interface DicPvpOpponent {
|
||||
|
||||
export const dicPvpOpponent = new Map<number, DicPvpOpponent>();
|
||||
export function loadPvpOpponent() {
|
||||
|
||||
dicPvpOpponent.splice(0, dicPvpOpponent.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_PVP_OPPONENT);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -14,6 +14,7 @@ export interface DicRankRewads {
|
||||
export const dicRankRewads = new Array<DicRankRewads>();
|
||||
export const dicRankMax: { max: DicRankRewads } = { max: undefined };
|
||||
export function loadPvpRankReward() {
|
||||
dicRankRewads.splice(0, dicRankRewads.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_PVP_RANK_REWARD);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface DicPvpTeamLevel {
|
||||
|
||||
export const dicPvpTeamLevel = new Array<DicPvpTeamLevel>();
|
||||
export function loadPvpTeamLevel() {
|
||||
|
||||
dicPvpTeamLevel.splice(0, dicPvpTeamLevel.length)
|
||||
let arr = readFileAndParse(FILENAME.DIC_PVP_TEAM_LEVEL);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface DicRank {
|
||||
|
||||
export const dicRank = new Array<DicRank>();
|
||||
export function loadRank() {
|
||||
|
||||
dicRank.splice(0, dicRank.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_RANK);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface DicRecruit {
|
||||
|
||||
export const dicRecruit = new Array<DicRecruit>();
|
||||
export function loadRecruit() {
|
||||
|
||||
dicRecruit.splice(0, dicRecruit.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_RECRUIT);
|
||||
|
||||
arr.forEach(o => {
|
||||
|
||||
@@ -25,7 +25,7 @@ const DicTaskTypeKeys: KeysEnum<DicTaskType> = {
|
||||
|
||||
export const dicTaskTypeDesc = new Array<DicTaskType>();
|
||||
export function loadTaskType() {
|
||||
|
||||
dicTaskTypeDesc.splice(0, dicTaskTypeDesc.length);
|
||||
let arr = readFileAndParse(FILENAME.DIC_TASK_TYPE);
|
||||
arr.forEach(o => {
|
||||
dicTaskTypeDesc.push(_.pick(o, Object.keys(DicTaskTypeKeys)));
|
||||
|
||||
@@ -38,6 +38,7 @@ export const dicWar = new Map<number, DicWar>();
|
||||
export const dicWarPvp = new Array<DicWar>();
|
||||
export const dicDailyWarByType = new Map<number, DicWar[]>();
|
||||
export function loadWar() {
|
||||
dicWarPvp.splice(0, dicWarPvp.length);
|
||||
for(let filename of WAR_RELATE_TABLES) {
|
||||
let arr = readFileAndParse(filename);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user