/* * @Author: dgflash * @Date: 2021-11-12 10:02:31 * @LastEditors: mojunshou 1637302775@qq.com * @LastEditTime: 2025-04-09 16:31:00 */ import { oops } from "db://oops-framework/core/Oops"; import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; /** * 游戏账号数据 */ interface CurLevelInfo { level: number; score: number; } interface CurLevelConfig { level: number; //当前关卡 score: number; //当前关卡目标分数 skipCount: number; //当前关卡跳过次数 eliminateScope: []; //消除配置 eventType: string //消除配置 } //费用配置 interface CostInfo { handlingCharge: number; //处理费 giftNum: number; //赠送金 } @ecs.register('AccountModel') export class AccountModelComp extends ecs.Comp { /** 账号名 */ _accountName: string = null!; /**玩家UID */ _uid: number = -1; /**玩家头像*/ _headUrl: string = null! /**当前关卡--默认从0开始*/ _curLevel: number = 0; /**游戏币*/ _gameCoin: number = 0; /**红包币*/ _cashCoin: number = 0; /**金块*/ _goldCoin: number = 0; /**手续费*/ _handlingCharge: number = 0; /**目标分数*/ _targetScore: number = 0; /**协议类型 1隐私 2用户*/ _protocolType: number = 1; //当前关卡信息 _curLevelInfo: CurLevelInfo = null!; /**当前关卡配置*/ _curLevelConfig: CurLevelConfig = null!; /**游戏费用配置*/ _costInfo: CostInfo = null!; /**是否登录过*/ _isLogined: boolean = false; reset() { this.accountName = null!; this.uid = -1; this.headUrl = null!; this.curLevel = 0; this.gameCoin = 0; this.cashCoin = 0; this.protocolType = 1; this.curLevelInfo = null!; this.curLevelConfig = null!; this.costInfo = null!; } get accountName() { return this._accountName; } set accountName(value: string) { this._accountName = value; } get uid() { return this._uid; } set uid(value: number) { this._uid = value; } get headUrl() { return this._headUrl; } set headUrl(value: string) { this._headUrl = value; } get curLevel() { return this._curLevel; } set curLevel(value: number) { this._curLevel = value; } get gameCoin() { return this._gameCoin; } set gameCoin(value: number) { this._gameCoin = value; } get cashCoin() { return this._cashCoin; } set cashCoin(value: number) { this._cashCoin = value; } get goldCoin() { return this._goldCoin; } set goldCoin(value: number) { this._goldCoin = value; } get handlingCharge() { return this._handlingCharge; } set handlingCharge(value: number) { this._handlingCharge = value; } get targetScore() { return this._targetScore; } set targetScore(value: number) { this._targetScore = value; } get protocolType() { return this._protocolType; } set protocolType(value: number) { this._protocolType = value; } get curLevelInfo() { return this._curLevelInfo; } set curLevelInfo(value: CurLevelInfo) { this._curLevelInfo = value; } get curLevelConfig() { return this._curLevelConfig; } set curLevelConfig(value: CurLevelConfig) { this._curLevelConfig = value; } get costInfo() { return this._costInfo; } set costInfo(value: CostInfo) { this._costInfo = value; } get isLogined() { return this._isLogined; } set isLogined(value: boolean) { this._isLogined = value; } }