| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- /*
- * @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;
- }
- }
|