AccountModelComp.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * @Author: dgflash
  3. * @Date: 2021-11-12 10:02:31
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-15 15:28:53
  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. _wxCoin: number = 0;
  24. /**红包币*/
  25. _hbCoin: number = 0;
  26. /**金块*/
  27. _goldCoin: number = 0;
  28. /**是否登录过*/
  29. _isLogined: boolean = false;
  30. /**消除次数*/
  31. _xcCount: number = 0;
  32. reset() {
  33. this.accountName = null!;
  34. this.uid = -1;
  35. this.headUrl = null!;
  36. this.curLevel = 0;
  37. }
  38. get accountName() {
  39. return this._accountName;
  40. }
  41. set accountName(value: string) {
  42. this._accountName = value;
  43. }
  44. get uid() {
  45. return this._uid;
  46. }
  47. set uid(value: number) {
  48. this._uid = value;
  49. }
  50. get headUrl() {
  51. return this._headUrl;
  52. }
  53. set headUrl(value: string) {
  54. this._headUrl = value;
  55. }
  56. get curLevel() {
  57. return this._curLevel;
  58. }
  59. set curLevel(value: number) {
  60. this._curLevel = value;
  61. }
  62. get wxCoin() {
  63. return this._wxCoin;
  64. }
  65. set wxCoin(value: number) {
  66. this._wxCoin = value;
  67. }
  68. get hbCoin() {
  69. return this._hbCoin;
  70. }
  71. set hbCoin(value: number) {
  72. this._hbCoin = value;
  73. }
  74. get goldCoin() {
  75. return this._goldCoin;
  76. }
  77. set goldCoin(value: number) {
  78. this._goldCoin = value;
  79. }
  80. get isLogined() {
  81. return this._isLogined;
  82. }
  83. set isLogined(value: boolean) {
  84. this._isLogined = value;
  85. }
  86. get xcCount() {
  87. return this._xcCount;
  88. }
  89. set xcCount(value: number) {
  90. this._xcCount = value;
  91. }
  92. }