协议修改

This commit is contained in:
chen wei bo
2025-08-25 16:27:24 +08:00
parent 6a6510e34a
commit e843f0fdcd
8 changed files with 1543 additions and 745 deletions
+37 -7
View File
@@ -4,29 +4,59 @@
import { BaseData } from "./BaseData";
export class PlayerData extends BaseData {
// 用户名
private _name: string = '';
private _score: number = 0;
// 钻石数
private _diamond: number = 0;
// vip失效时间戳
private _vipExpire: number = 0;
public reset(): void {
this._name = '';
this._score = 0;
this._diamond = 0;
this._vipExpire = 0;
}
public clear(): void {
this._name = '';
this._score = 0;
this._diamond = 0;
this._vipExpire = 0;
}
public destroy(): void {
super.destroy();
// 这里可以做额外释放资源的操作
this._name = null;
this._diamond = null;
this._vipExpire = null;
}
public setName(name: string): void {
this._name = name;
/** 设置用户名 */
public set name(value: string) {
this._name = value;
}
public getName(): string {
/** 获取用户名 */
public get name(): string {
return this._name;
}
/** 设置钻石数 */
public set diamond(value: number) {
this._diamond = value;
}
/** 获取钻石数 */
public get diamond(): number {
return this._diamond;
}
/** 设置vip失效时间戳 */
public set vipExpire(value: number) {
this._vipExpire = value;
}
/** 获取vip失效时间戳 */
public get vipExpire(): number {
return this._vipExpire;
}
}