77 lines
1.6 KiB
TypeScript
77 lines
1.6 KiB
TypeScript
/**
|
|
* 技师的好感度数据
|
|
*/
|
|
import { BaseData } from "./BaseData";
|
|
import proto from 'db://assets/Scripts/proto/proto.pb.js';
|
|
|
|
export class GirlFavorabilityData extends BaseData {
|
|
// id
|
|
private id: number;
|
|
// 星级
|
|
private star: number;
|
|
// 收藏时间,时间戳,秒,0: 表示还没收藏
|
|
private bookmarkTime: number;
|
|
|
|
constructor() {
|
|
super();
|
|
this.id = 0;
|
|
this.star = 0;
|
|
this.bookmarkTime = 0;
|
|
}
|
|
|
|
public reset(): void {
|
|
this.id = 0;
|
|
this.star = 0;
|
|
this.bookmarkTime = 0;
|
|
}
|
|
|
|
public clear(): void {
|
|
this.id = 0;
|
|
this.star = 0;
|
|
this.bookmarkTime = 0;
|
|
}
|
|
|
|
public destroy(): void {
|
|
super.destroy();
|
|
this.id = null;
|
|
this.star = null;
|
|
this.bookmarkTime = null;
|
|
}
|
|
|
|
/** 获取 id */
|
|
public getId(): number {
|
|
return this.id;
|
|
}
|
|
|
|
/** 保存 id */
|
|
public setId(value: number): void {
|
|
this.id = value;
|
|
}
|
|
|
|
/** 获取星级 */
|
|
public getStar(): number {
|
|
return this.star;
|
|
}
|
|
|
|
/** 保存星级 */
|
|
public setStar(value: number): void {
|
|
this.star = value;
|
|
}
|
|
|
|
/** 获取 收藏时间,时间戳,秒 */
|
|
public getBookmarkTime(): number {
|
|
return this.bookmarkTime;
|
|
}
|
|
|
|
/** 保存 收藏时间,时间戳,秒 */
|
|
public setBookmarkTime(value: number): void {
|
|
this.bookmarkTime = value;
|
|
// logger.log("设置角色 ", this.id, " 的收藏时间:", this.bookmarkTime);
|
|
}
|
|
|
|
/** 是否已经收藏 */
|
|
public isBookmarkGirl(): boolean {
|
|
return this.bookmarkTime !== 0;
|
|
}
|
|
}
|