0e87907262cdfe9bb04b67b17e1eca1e38126d79.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. System.register(["__unresolved_0", "cc", "__unresolved_1"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, TableUtil, _dec, _class, _class2, _crd, ccclass, property, table_store;
  4. function _reportPossibleCrUseOfTableUtil(extras) {
  5. _reporterNs.report("TableUtil", "./TableUtil", _context.meta, extras);
  6. }
  7. return {
  8. setters: [function (_unresolved_) {
  9. _reporterNs = _unresolved_;
  10. }, function (_cc) {
  11. _cclegacy = _cc.cclegacy;
  12. __checkObsolete__ = _cc.__checkObsolete__;
  13. __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
  14. _decorator = _cc._decorator;
  15. }, function (_unresolved_2) {
  16. TableUtil = _unresolved_2.TableUtil;
  17. }],
  18. execute: function () {
  19. _crd = true;
  20. _cclegacy._RF.push({}, "99137Yt4d1L6JBAI6/xf5DC", "table_store", undefined);
  21. __checkObsolete__(['_decorator', 'Component', 'Node']);
  22. ({
  23. ccclass,
  24. property
  25. } = _decorator);
  26. _export("table_store", table_store = (_dec = ccclass('table_store'), _dec(_class = (_class2 = class table_store {
  27. constructor() {
  28. this.data = void 0;
  29. /** 编号【KEY】 */
  30. this.id = 0;
  31. }
  32. static get(id) {
  33. return (_crd && TableUtil === void 0 ? (_reportPossibleCrUseOfTableUtil({
  34. error: Error()
  35. }), TableUtil) : TableUtil).getTable(table_store, id);
  36. }
  37. static getList() {
  38. return (_crd && TableUtil === void 0 ? (_reportPossibleCrUseOfTableUtil({
  39. error: Error()
  40. }), TableUtil) : TableUtil).getTables(table_store, 5);
  41. }
  42. init(id) {
  43. var table = (_crd && TableUtil === void 0 ? (_reportPossibleCrUseOfTableUtil({
  44. error: Error()
  45. }), TableUtil) : TableUtil).get(table_store.TableName);
  46. this.data = table[id];
  47. if (!this.data) console.error("配置表" + table_store.TableName + "没有ID:" + id);
  48. this.id = id;
  49. }
  50. get type() {
  51. return this.data.type;
  52. }
  53. get cost() {
  54. return this.data.cost;
  55. }
  56. get num() {
  57. return this.data.num;
  58. }
  59. get name() {
  60. return this.data.name;
  61. }
  62. }, _class2.TableName = "store", _class2)) || _class));
  63. _cclegacy._RF.pop();
  64. _crd = false;
  65. }
  66. };
  67. });
  68. //# sourceMappingURL=0e87907262cdfe9bb04b67b17e1eca1e38126d79.js.map