AccountModelComp.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /*
  2. * @Author: dgflash
  3. * @Date: 2021-11-12 10:02:31
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-09 17:32:45
  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. interface CurLevelInfo {
  13. level: number;
  14. score: number;
  15. }
  16. interface CurLevelConfig {
  17. level: number; //当前关卡
  18. score: number; //当前关卡目标分数
  19. skipCount: number; //当前关卡跳过次数
  20. eliminateScope: []; //消除配置
  21. eventType: string //消除配置
  22. }
  23. //费用配置
  24. interface CostInfo {
  25. handlingCharge: number; //处理费
  26. giftNum: number; //赠送金
  27. }
  28. interface RecordInfo {
  29. title: string,
  30. amount: number,
  31. payMethod: number,
  32. createTime: number,
  33. successTime: number,
  34. status: number
  35. }
  36. @ecs.register('AccountModel')
  37. export class AccountModelComp extends ecs.Comp {
  38. /** 账号名 */
  39. _accountName: string = null!;
  40. /**玩家UID */
  41. _uid: number = -1;
  42. /**玩家头像*/
  43. _headUrl: string = null!
  44. /**当前关卡--默认从0开始*/
  45. _curLevel: number = 0;
  46. /**游戏币*/
  47. _gameCoin: number = 0;
  48. /**红包币*/
  49. _cashCoin: number = 0;
  50. /**金块*/
  51. _goldCoin: number = 0;
  52. /**手续费*/
  53. _handlingCharge: number = 0;
  54. /**当前分数*/
  55. _curScore: number = 0;
  56. /**目标分数*/
  57. _targetScore: number = 0;
  58. /**协议类型 1隐私 2用户*/
  59. _protocolType: number = 1;
  60. //当前关卡信息
  61. _curLevelInfo: CurLevelInfo = null!;
  62. /**当前关卡配置*/
  63. _curLevelConfig: CurLevelConfig = null!;
  64. /**游戏费用配置*/
  65. _costInfo: CostInfo = null!;
  66. /**是否登录过*/
  67. _isLogined: boolean = false;
  68. //提现记录
  69. _recordList: RecordInfo[] = [];
  70. reset() {
  71. this.accountName = null!;
  72. this.uid = -1;
  73. this.headUrl = null!;
  74. this.curLevel = 0;
  75. this.gameCoin = 0;
  76. this.cashCoin = 0;
  77. this.protocolType = 1;
  78. this.curLevelInfo = null!;
  79. this.curLevelConfig = null!;
  80. this.costInfo = null!;
  81. }
  82. get accountName() {
  83. return this._accountName;
  84. }
  85. set accountName(value: string) {
  86. this._accountName = value;
  87. }
  88. get uid() {
  89. return this._uid;
  90. }
  91. set uid(value: number) {
  92. this._uid = value;
  93. }
  94. get headUrl() {
  95. return this._headUrl;
  96. }
  97. set headUrl(value: string) {
  98. this._headUrl = value;
  99. }
  100. get curLevel() {
  101. return this._curLevel;
  102. }
  103. set curLevel(value: number) {
  104. this._curLevel = value;
  105. }
  106. get gameCoin() {
  107. return this._gameCoin;
  108. }
  109. set gameCoin(value: number) {
  110. this._gameCoin = value;
  111. }
  112. get cashCoin() {
  113. return this._cashCoin;
  114. }
  115. set cashCoin(value: number) {
  116. this._cashCoin = value;
  117. }
  118. get goldCoin() {
  119. return this._goldCoin;
  120. }
  121. set goldCoin(value: number) {
  122. this._goldCoin = value;
  123. }
  124. get handlingCharge() {
  125. return this._handlingCharge;
  126. }
  127. set handlingCharge(value: number) {
  128. this._handlingCharge = value;
  129. }
  130. set curScore(value: number) {
  131. this._curScore = value;
  132. }
  133. get curScore() {
  134. return this._curScore;
  135. }
  136. get targetScore() {
  137. return this._targetScore;
  138. }
  139. set targetScore(value: number) {
  140. this._targetScore = value;
  141. }
  142. get protocolType() {
  143. return this._protocolType;
  144. }
  145. set protocolType(value: number) {
  146. this._protocolType = value;
  147. }
  148. get curLevelInfo() {
  149. return this._curLevelInfo;
  150. }
  151. set curLevelInfo(value: CurLevelInfo) {
  152. this._curLevelInfo = value;
  153. }
  154. get curLevelConfig() {
  155. return this._curLevelConfig;
  156. }
  157. set curLevelConfig(value: CurLevelConfig) {
  158. this._curLevelConfig = value;
  159. }
  160. get costInfo() {
  161. return this._costInfo;
  162. }
  163. set costInfo(value: CostInfo) {
  164. this._costInfo = value;
  165. }
  166. get isLogined() {
  167. return this._isLogined;
  168. }
  169. set isLogined(value: boolean) {
  170. this._isLogined = value;
  171. }
  172. get recordList() {
  173. return this._recordList;
  174. }
  175. set recordList(value: RecordInfo[]) {
  176. this.recordList = value;
  177. }
  178. }