AccountModelComp.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /*
  2. * @Author: dgflash
  3. * @Date: 2021-11-12 10:02:31
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-10 15:24:29
  6. */
  7. import { oops } from "db://oops-framework/core/Oops";
  8. import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
  9. /**
  10. * 游戏账号数据
  11. */
  12. @ecs.register('AccountModel')
  13. export class AccountModelComp extends ecs.Comp {
  14. /** 账号名 */
  15. _accountName: string = null!;
  16. /**玩家UID */
  17. _uid: number = -1;
  18. /**玩家头像*/
  19. _headUrl: string = null!
  20. /**当前关卡--默认从0开始*/
  21. _curLevel: number = 0;
  22. /**游戏币*/
  23. _gameCoin: number = 0;
  24. /**红包币*/
  25. _cashCoin: number = 0;
  26. /**金块*/
  27. _goldCoin: number = 0;
  28. /**是否登录过*/
  29. _isLogined: boolean = false;
  30. // /**手续费*/
  31. // _handlingCharge: number = 0;
  32. // /**当前分数*/
  33. // _curScore: number = 0;
  34. // /**目标分数*/
  35. // _targetScore: number = 0;
  36. // /**协议类型 1隐私 2用户*/
  37. // _protocolType: number = 1;
  38. // //当前关卡信息
  39. // _curLevelInfo: CurLevelInfo = null!;
  40. // /**当前关卡配置*/
  41. // _curLevelConfig: CurLevelConfig = null!;
  42. // /**游戏费用配置*/
  43. // _costInfo: CostInfo = null!;
  44. // //提现记录
  45. // _recordList: RecordInfo[] = [];
  46. // //是否是广告时间
  47. // _isShowAd: boolean = false;
  48. reset() {
  49. this.accountName = null!;
  50. this.uid = -1;
  51. this.headUrl = null!;
  52. this.curLevel = 0;
  53. this.gameCoin = 0;
  54. this.cashCoin = 0;
  55. }
  56. get accountName() {
  57. return this._accountName;
  58. }
  59. set accountName(value: string) {
  60. this._accountName = value;
  61. }
  62. get uid() {
  63. return this._uid;
  64. }
  65. set uid(value: number) {
  66. this._uid = value;
  67. }
  68. get headUrl() {
  69. return this._headUrl;
  70. }
  71. set headUrl(value: string) {
  72. this._headUrl = value;
  73. }
  74. get curLevel() {
  75. return this._curLevel;
  76. }
  77. set curLevel(value: number) {
  78. this._curLevel = value;
  79. }
  80. get gameCoin() {
  81. return this._gameCoin;
  82. }
  83. set gameCoin(value: number) {
  84. this._gameCoin = value;
  85. }
  86. get cashCoin() {
  87. return this._cashCoin;
  88. }
  89. set cashCoin(value: number) {
  90. this._cashCoin = value;
  91. }
  92. get goldCoin() {
  93. return this._goldCoin;
  94. }
  95. set goldCoin(value: number) {
  96. this._goldCoin = value;
  97. }
  98. get isLogined() {
  99. return this._isLogined;
  100. }
  101. set isLogined(value: boolean) {
  102. this._isLogined = value;
  103. }
  104. }