测试:添加战斗测试

This commit is contained in:
luying
2021-11-03 20:04:06 +08:00
parent 88e7ee906d
commit fb59fcd0ca
13 changed files with 364 additions and 22 deletions

View File

@@ -21,9 +21,9 @@ export async function getDailyBattleList(role: RoleType) {
let dicDaily = gameData.daily;
let result = new Array();
for(let {dailyType: type, name, timesPerDay, timesCanBuy } of dicDaily) {
for(let {dailyType: type, timesPerDay, timesCanBuy } of dicDaily) {
let refreshResult = await DailyRecordModel.refreshRecord(roleId, type);
let wars: {battleId: number, cost: number, star: number, status: number, name: string}[] = new Array();
let wars: {battleId: number, cost: number, star: number, status: number}[] = new Array();
let dicDailyWar = gameData.dailyWarByType.get(type);
for(let dic of dicDailyWar) {
let war = getDailyWarStatus(dic, warStar);
@@ -31,7 +31,7 @@ export async function getDailyBattleList(role: RoleType) {
}
let checkDailyResult = await getDailyNum(refreshResult, timesPerDay, timesCanBuy);
result.push({
type, name, ...checkDailyResult,
type, ...checkDailyResult,
wars
});
}
@@ -39,7 +39,7 @@ export async function getDailyBattleList(role: RoleType) {
}
function getDailyWarStatus(dicDailyWar: DicWar, warStar: WarStar[]) {
let {war_id, cost, gk_name, previousGk } = dicDailyWar;
let {war_id, cost, previousGk } = dicDailyWar;
let status = 0, star = 0;
let curBattle = warStar.find(cur => cur.id == war_id);
if(curBattle) {
@@ -58,7 +58,7 @@ function getDailyWarStatus(dicDailyWar: DicWar, warStar: WarStar[]) {
}
}
return {
battleId: war_id, cost, star, status, name: gk_name
battleId: war_id, cost, star, status
}
}