Files
18xchat/assets/Scripts/chat18x/data/PlayerData.ts
T

32 lines
558 B
TypeScript
Raw Normal View History

2025-08-14 16:30:08 +08:00
/**
* 玩家数据
*/
import { BaseData } from "./BaseData";
export class PlayerData extends BaseData {
2025-08-25 16:27:18 +08:00
// 用户名
2025-08-14 16:30:08 +08:00
private _name: string = '';
public reset(): void {
this._name = '';
}
public clear(): void {
this._name = '';
}
public destroy(): void {
super.destroy();
2025-08-25 16:27:18 +08:00
this._name = null;
2025-08-14 16:30:08 +08:00
}
2025-08-25 16:27:18 +08:00
/** 设置用户名 */
public set name(value: string) {
this._name = value;
2025-08-14 16:30:08 +08:00
}
2025-08-25 16:27:18 +08:00
/** 获取用户名 */
public get name(): string {
2025-08-14 16:30:08 +08:00
return this._name;
2025-09-09 10:30:46 +08:00
}
2025-08-14 16:30:08 +08:00
}