好友:赠送领取爱心
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { RoleType } from "../../db/Role";
|
||||
import { FriendShipType } from "../../db/FriendShip";
|
||||
import * as friendUtil from '../../pubUtils/friendUtil'
|
||||
import { Relation } from "../../db/FriendRelation";
|
||||
|
||||
export class FriendParams {
|
||||
roleId: string;
|
||||
@@ -57,28 +59,38 @@ export class FriendListParam extends FriendParams {
|
||||
canReceive: boolean = false; // 初始没人送肯定不能领取
|
||||
canSend: boolean = true; // 初始可以赠送
|
||||
|
||||
constructor(role: RoleType, friendship: FriendShipType) {
|
||||
constructor(role: RoleType, myRoleId: string, friendship: FriendShipType) {
|
||||
super(role);
|
||||
if(role.guildName) this.guildName = role.guildName;
|
||||
this.quitTime = role.quitTime;
|
||||
|
||||
this.friendLv = friendship.friendLv;
|
||||
this.friendValue = friendship.friendValue;
|
||||
|
||||
friendUtil.setCanReceiveAndCanSend.bind(this, myRoleId, friendship)();
|
||||
}
|
||||
|
||||
setOnline(isOnline: boolean) {
|
||||
this.isOnline = isOnline;
|
||||
}
|
||||
|
||||
setCanReceive(canReceive: boolean) {
|
||||
this.canReceive = canReceive;
|
||||
}
|
||||
|
||||
setCanSend(canSend: boolean) {
|
||||
this.canSend = canSend;
|
||||
}
|
||||
}
|
||||
|
||||
export class FriendValueListParam {
|
||||
roleId: string;
|
||||
friendValue: number = 0;
|
||||
friendLv: number = 1;
|
||||
canReceive: boolean = false;
|
||||
canSend: boolean = true;
|
||||
|
||||
constructor(roleId: string, myRoleId: string, friendship: FriendShipType) {
|
||||
this.roleId = roleId;
|
||||
|
||||
this.friendLv = friendship.friendLv;
|
||||
this.friendValue = friendship.friendValue;
|
||||
|
||||
friendUtil.setCanReceiveAndCanSend.bind(this, myRoleId, friendship)();
|
||||
}
|
||||
}
|
||||
|
||||
export class BlackListParam extends FriendParams {
|
||||
guildName: string = "";
|
||||
|
||||
Reference in New Issue
Block a user