89 lines
2.6 KiB
TypeScript
89 lines
2.6 KiB
TypeScript
import { PvpEnemies, PvpOtherHeroes } from "../../db/generalField";
|
|
import { reduceCe } from "../../pubUtils/util";
|
|
import { GuildType } from "../../db/Guild";
|
|
import { RoleType } from "../../db/Role";
|
|
|
|
export class PlayerDetailHero {
|
|
actorId: number;
|
|
lv: number;
|
|
star: number;
|
|
colorStar: number;
|
|
quality: number;
|
|
score: number;
|
|
|
|
setPvpHeroInfo?(hero: PvpEnemies|PvpOtherHeroes) {
|
|
this.actorId = hero.actorId;
|
|
this.lv = hero.lv;
|
|
this.star = hero.star;
|
|
this.colorStar = hero.colorStar;
|
|
this.quality = hero.quality;
|
|
this.score = hero.score;
|
|
}
|
|
}
|
|
|
|
export class PlayerDetail {
|
|
roleId: string;
|
|
roleName: string;
|
|
lv: number;
|
|
title?: number = 1;
|
|
sHid?: number = 19;
|
|
headHid?: number = 19;
|
|
|
|
score?: number = 0;
|
|
pLv?: number = 1;
|
|
defCe?: number = 0;
|
|
|
|
heroes: PlayerDetailHero[];
|
|
rank?:number = 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.sHid) this.sHid = detail.sHid;
|
|
if(detail.headHid) this.headHid = detail.headHid;
|
|
if(detail.score) this.score = detail.score;
|
|
if(detail.pLv) this.pLv = detail.pLv;
|
|
if(detail.defCe) this.defCe = reduceCe(detail.defCe);
|
|
if(detail.heroes) this.heroes = detail.heroes;
|
|
if(detail.rank) this.rank = detail.rank;
|
|
}
|
|
}
|
|
|
|
// 军团返回
|
|
export class GuildMainInfo {
|
|
code: string; // 军团唯一编号
|
|
icon: number; // 头像
|
|
name: string; // 军团名
|
|
lv: number; // 等级
|
|
memberCnt: number; // 人数
|
|
isAuto: boolean; // 是否是自动加入
|
|
ceLimit: number; // 战力条件
|
|
|
|
constructor(guild: GuildType) {
|
|
this.code = guild.code;
|
|
this.icon = guild.icon;
|
|
this.name = guild.name;
|
|
this.lv = guild.lv;
|
|
this.memberCnt = guild.memberCnt;
|
|
this.ceLimit = guild.ceLimit;
|
|
this.isAuto = guild.isAuto;
|
|
}
|
|
}
|
|
|
|
// getGuildList里的返回
|
|
export class GuildListInfo extends GuildMainInfo {
|
|
leader: string; // 团长名
|
|
hasApply: boolean = false; // 是否有申请过
|
|
|
|
constructor(guild: GuildType) {
|
|
super(guild);
|
|
let leader = <RoleType>guild.leader;
|
|
this.leader = leader.roleName;
|
|
}
|
|
|
|
setApply(hasApply: boolean) {
|
|
this.hasApply = hasApply;
|
|
}
|
|
}
|