/* * @Author: mojunshou 1637302775@qq.com * @Date: 2025-04-10 14:49:42 * @LastEditors: mojunshou 1637302775@qq.com * @LastEditTime: 2025-04-10 18:24:31 * @Description: */ import { ecs } from "db://oops-framework/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; //赠送金 } interface RecordInfo { title: string, amount: number, payMethod: number, createTime: number, successTime: number, status: number } interface goodsList { propId: string, propNum: number } interface PassViewInfo { showReward: goodsList[] doubleReward: boolean } /** 数据层对象 */ @ecs.register('GameModel') export class GameModelComp extends ecs.Comp { id: number = -1; // /**手续费*/ _handlingCharge: number = 0; /**当前分数*/ _curScore: number = 0; /**目标分数*/ _targetScore: number = 0; /**协议类型 1隐私 2用户*/ _protocolType: number = 1; //当前关卡信息 _curLevelInfo: CurLevelInfo = null!; /**当前关卡配置*/ _curLevelConfig: CurLevelConfig = null!; /**游戏费用配置*/ _costInfo: CostInfo = null!; //提现记录 _recordList: RecordInfo[] = []; //是否是广告时间 _isShowAd: boolean = false; /**激励广告价值*/ _price: number = 0; /**看完广告是否发奖励*/ _isDone: boolean = false; /**通关奖励*/ _passViewInfo: PassViewInfo = null!; /**视频签名*/ _sign: string = ""; /** 数据层组件移除时,重置所有数据为默认值 */ reset() { this.id = -1; this.protocolType = 1; this.curLevelInfo = null!; this.curLevelConfig = null!; this.costInfo = null!; } set price(value: number) { this._price = value; } get price() { return this._price; } set isDone(value: boolean) { this._isDone = value; } get isDone() { return this._isDone; } set sign(value: string) { this._sign = value; } get sign() { return this._sign; } get handlingCharge() { return this._handlingCharge; } set handlingCharge(value: number) { this._handlingCharge = value; } set curScore(value: number) { this._curScore = value; } get curScore() { return this._curScore; } 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 recordList() { return this._recordList; } set recordList(value: RecordInfo[]) { this.recordList = value; } get isShowAd() { return this._isShowAd; } set isShowAd(value: boolean) { this._isShowAd = value } get passViewInfo() { return this._passViewInfo; } set passViewInfo(value: PassViewInfo) { this._passViewInfo = value; } }