| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- /*
- * @Author: dgflash
- * @Date: 2021-11-12 10:02:31
- * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-09 14:12:47
- */
- 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;
- /**目标分数*/
- 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!;
- }
- //保存微信数据
- setWechatInfo(data: any) {
- this.accountName = data.nickname;
- this.uid = data.uid;
- this.headUrl = data.headImgUrl;
- }
- //设置账号数据
- setAccountInfo(data: any) {
- // this.AccountName = data.accountName;
- this.uid = data.uid;
- this.curLevelInfo = data.currentLevelInfo;
- this.curLevelConfig = data.currentLevelConfig;
- this.costInfo = data.handlingChargeConf;
- this.isLogined = data.logined;
- }
- }
|