🐞 fix(gvg): 调整spine下发数量开关

This commit is contained in:
luying
2023-03-10 13:30:03 +08:00
parent 38b7b66263
commit 621608d0cf
4 changed files with 24 additions and 10 deletions
@@ -24,14 +24,19 @@ class GVGBattleData {
this.groupKey = groupKey;
}
public findTeamsByArea(areaId: number) {
public findTeamsByArea(areaId: number, count: number) {
let teamCodes = this.areaToTeams.get(areaId)||new Set();
let teams: GVGTeamMem[] = [];
let otherTeams: GVGTeamMem[] = [], robots: GVGTeamMem[] = [], points: GVGTeamMem[] = [];
for(let teamCode of teamCodes) {
let team = this.teams.get(teamCode);
if(team && !team.isBroken) teams.push(team);
if(team && !team.isBroken) {
if(team.pointId > 0) { points.push(team); continue; }
if(team.isRobot) { robots.push(team); continue; }
otherTeams.push(team);
}
}
return teams.slice(0, 20);
let teams = [...points, ...robots, ...otherTeams];
return teams.slice(0, count);
}
public findCatapultAttackTeam(areaId: number, leagueCode: string) {