军团,创建查询列表,查询个人军团信息

This commit is contained in:
luying
2021-01-19 16:18:45 +08:00
parent 71c5182926
commit ee21a21e80
8 changed files with 220 additions and 97 deletions

View File

@@ -2,6 +2,8 @@
import { reduceCe } from "./util";
import { PvpEnemies, PvpHeroInfo, PvpOtherHeroes } from "../db/generalField";
import { GuildType } from "../db/Guild";
import { RoleType } from "../db/Role";
export interface RewardInter {
id: number;
@@ -165,4 +167,41 @@ export class PlayerDetail {
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;
}
}