表引用
This commit is contained in:
@@ -12,6 +12,7 @@ const towerTaskInfos = new Map<number, any>();
|
||||
const heroInfos = new Map<number, any>();
|
||||
const jobInfos = new Map<number, any>();
|
||||
const jobClassMaxGrades = new Map<number, number>();
|
||||
const jobClassAndgrades = new Map<string, {jobid:number, unlockLevel:number}>();
|
||||
const levelInfos = new Map<number, {sum: number, cur: number}>();
|
||||
const heroLevelInfo = new Map<number, number>();
|
||||
const starRatioInfo = new Map<number, number>();
|
||||
@@ -26,7 +27,8 @@ const blueprtToWar = new Map<number, number>();
|
||||
const goodInfo = new Map<number, any>();
|
||||
const blueprt = new Map<number, Array<number>>();
|
||||
const blueprtCompose = new Map<number, any>();
|
||||
|
||||
const fiendShips = new Map<number, any>();
|
||||
const fashions = new Map<number, any>();
|
||||
function parseWarData() {
|
||||
let result = null;
|
||||
for (let filename of wars) {
|
||||
@@ -102,6 +104,7 @@ function parseJobData() {
|
||||
if (maxLevel < elem.grade) {
|
||||
jobClassMaxGrades.set(elem.job_class, elem.grade);
|
||||
}
|
||||
jobClassAndgrades.set(elem.job_class+'_'+elem.grade,{unlockLevel:elem.unlockLevel, jobid:elem.jobid});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -236,6 +239,33 @@ function parseBlueprtCompose() {
|
||||
});
|
||||
}
|
||||
|
||||
function parseFashions() {
|
||||
const file = 'dic_zyz_fashions';
|
||||
const data = gamedata['jsons'][file] || [];
|
||||
data.forEach(elem => {
|
||||
if (elem && elem.id) {
|
||||
fashions.set(elem.id, elem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function parseFiendShips() {
|
||||
const file = 'dic_zyz_friend_ship';
|
||||
const data = gamedata['jsons'][file] || [];
|
||||
data.forEach(elem => {
|
||||
if (elem && elem.id) {
|
||||
fashions.set(elem.id, elem);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function parseFiendShipLevels() {
|
||||
const file = 'dic_zyz_friend_ship_level';
|
||||
const data = gamedata['jsons'][file] || [];
|
||||
data.sort(function(a, b) {
|
||||
return a.level - b.level;
|
||||
})
|
||||
}
|
||||
function initData (folder: string) {
|
||||
if(!gamedata.hasOwnProperty(folder)) {
|
||||
gamedata[folder] = {};
|
||||
@@ -276,6 +306,9 @@ function parseData() {
|
||||
parseComBtlData();
|
||||
parseGood();
|
||||
parseBlueprtCompose();
|
||||
parseFashions();
|
||||
parseFiendShips();
|
||||
parseFiendShipLevels();
|
||||
}
|
||||
|
||||
initData('jsons'); // 加载一般json
|
||||
@@ -436,4 +469,20 @@ export function hasExpeditionById(id: number) {
|
||||
|
||||
export function getBlueprtComposeByQuality(quality: number) {
|
||||
return blueprtCompose.get(quality);
|
||||
}
|
||||
|
||||
export function getFashionsById(id:number) {
|
||||
return fashions.get(id);
|
||||
}
|
||||
export function getFriendShipById(id:number) {
|
||||
return fiendShips.get(id);
|
||||
}
|
||||
|
||||
export function getFriendShipLevels() {
|
||||
const file = 'dic_zyz_friend_ship_level';
|
||||
return gamedata['jsons'][file] || [];
|
||||
}
|
||||
|
||||
export function getJobByGradeAndClass(jobClass:number, grade: number) {
|
||||
return jobClassAndgrades.get(jobClass +'_' + grade);
|
||||
}
|
||||
Reference in New Issue
Block a user