战力:获取显示数据

This commit is contained in:
luying
2022-03-30 14:22:46 +08:00
parent ef731fc979
commit 9adbd08d3c
33 changed files with 205 additions and 1689 deletions
+4 -24
View File
@@ -1,7 +1,6 @@
import { EXTERIOR } from "../pubUtils/dicParam";
import { WoodenHorse } from "./battleField/guildActivity";
import { RoleUpdate, RoleType } from "../db/Role";
import { reduceCe } from "../pubUtils/util";
import { GuildUpdateParam } from "../db/Guild";
import { HeroUpdate, } from "../db/Hero";
import { getSeconds } from "../pubUtils/timeUtil";
@@ -38,7 +37,7 @@ export class RankParam {
@prop({ required: true })
updatedAt?: number = 0;
constructor(role: RoleUpdate|RankParam, fromDb: boolean) {
constructor(role: RoleUpdate|RankParam) {
if(role.roleName) this.roleName = role.roleName;
if(role.lv) this.lv = role.lv;
if(role.head) this.head = role.head;
@@ -46,13 +45,7 @@ export class RankParam {
if(role.spine) this.spine = role.spine;
if(role.title) this.title = role.title;
if(role.guildName) this.guildName = role.guildName||"";
if(role.ce) {
if(fromDb && !(<RoleUpdate>role).isReducedCe) {
this.ce = reduceCe(role.ce);
} else {
this.ce = role.ce;
}
}
if(role.ce) this.ce = role.ce;
if(role.updatedAt) {
if(typeof role.updatedAt == 'number') {
this.updatedAt = role.updatedAt;
@@ -178,27 +171,14 @@ export class GuildRankParam {
@prop({ required: true })
guildCe: number;
constructor(guild: GuildUpdateParam, fromDb: boolean) {
constructor(guild: GuildUpdateParam) {
this.icon = guild.icon;
this.name = guild.name;
this.lv = guild.lv;
let leader = <RoleType>guild.leader;
let _leader = new GuildLeader(leader);
this.leader = _leader;
// console.log('*****', guild.isReducedCe, guild.guildCe, reduceCe(guild.guildCe))
if(guild.isReducedCe) {
this.guildCe = guild.guildCe;
} else {
this.guildCe = reduceCe(guild.guildCe);
}
if(fromDb && !(<GuildUpdateParam>guild).isReducedCe) {
this.guildCe = reduceCe(guild.guildCe);
} else {
this.guildCe = guild.guildCe;
}
this.guildCe = guild.guildCe;
this.memberCnt = guild.memberCnt;
}
}