pvp:修复赛季初始排行
This commit is contained in:
@@ -6,6 +6,7 @@ import { gameData } from "../../pubUtils/data";
|
||||
import { EXTERIOR } from "../../pubUtils/dicParam";
|
||||
import { HeroType } from "../../db/Hero";
|
||||
import { PvpDefenseType } from "../../db/PvpDefense";
|
||||
import { PvpHistoryOppType } from "../../db/PvpHistoryOpp";
|
||||
|
||||
export class PlayerDetailHero {
|
||||
actorId: number;
|
||||
@@ -99,19 +100,48 @@ export class PlayerDetail {
|
||||
|
||||
battle?: PlayerDetailBattle = new PlayerDetailBattle([], 0, 0);
|
||||
|
||||
constructor(detail: PlayerDetail) {
|
||||
if(detail.roleId) this.roleId = detail.roleId;
|
||||
if(detail.roleName) this.roleName = detail.roleName;
|
||||
if(detail.lv) this.lv = detail.lv;
|
||||
if(detail.title) this.title = detail.title;
|
||||
if(detail.head) this.head = detail.head;
|
||||
if(detail.frame) this.frame = detail.frame;
|
||||
if(detail.spine) this.spine = detail.spine;
|
||||
if(detail.score) this.score = detail.score;
|
||||
if(detail.pLv) this.pLv = detail.pLv;
|
||||
if(detail.defCe) this.defCe = detail.defCe;
|
||||
if(detail.heroes) this.heroes = detail.heroes;
|
||||
if(detail.rank) this.rank = detail.rank;
|
||||
constructor(roleId: string, heroes: PlayerDetailHero[], rank: number) {
|
||||
this.roleId = roleId;
|
||||
this.heroes = heroes;
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
setRobot(pvpHistoryOpp: PvpHistoryOppType) {
|
||||
if(pvpHistoryOpp.roleName) this.roleName = pvpHistoryOpp.roleName;
|
||||
if(pvpHistoryOpp.lv) this.lv = pvpHistoryOpp.lv;
|
||||
if(pvpHistoryOpp.title) this.title = pvpHistoryOpp.title;
|
||||
if(pvpHistoryOpp.head) this.head = pvpHistoryOpp.head;
|
||||
if(pvpHistoryOpp.frame) this.frame = pvpHistoryOpp.frame;
|
||||
if(pvpHistoryOpp.spine) this.spine = pvpHistoryOpp.spine;
|
||||
if(pvpHistoryOpp.score) this.score = pvpHistoryOpp.score;
|
||||
if(pvpHistoryOpp.pLv) this.pLv = pvpHistoryOpp.pLv;
|
||||
if(pvpHistoryOpp.defCe) this.defCe = pvpHistoryOpp.defCe;
|
||||
}
|
||||
|
||||
setPlayer(role: RoleType, ) {
|
||||
if(role.roleName) this.roleName = role.roleName;
|
||||
if(role.lv) this.lv = role.lv;
|
||||
if(role.title) this.title = role.title;
|
||||
if(role.head) this.head = role.head;
|
||||
if(role.frame) this.frame = role.frame;
|
||||
if(role.spine) this.spine = role.spine;
|
||||
}
|
||||
|
||||
setCe(ce: number) {
|
||||
this.defCe = ce;
|
||||
}
|
||||
|
||||
setPvpDefense(pvpDefense: PvpDefenseType) {
|
||||
if(pvpDefense.score) this.score = pvpDefense.score;
|
||||
if(pvpDefense.defense && pvpDefense.lineupCe) {
|
||||
let defCe = 0;
|
||||
for(let { actorId } of pvpDefense.defense.heroes) {
|
||||
let lineupCe = pvpDefense.lineupCe.find(cur => cur.hid == actorId);
|
||||
if(lineupCe) defCe += lineupCe.ce;
|
||||
}
|
||||
this.defCe = defCe;
|
||||
this.pLv = pvpDefense.defense.pLv;
|
||||
}
|
||||
}
|
||||
|
||||
setWarStar?(warStar: WarStar[], pvp: number, tower: number) {
|
||||
|
||||
Reference in New Issue
Block a user