593dadc4-1040-4f87-9343-8b36d5840ebc.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. "use strict";
  2. cc._RF.push(module, '593da3EEEBPh5NDizbVhA68', 'SimpleCommand');
  3. // lightMVC/core/command/SimpleCommand.ts
  4. "use strict";
  5. var __extends = (this && this.__extends) || (function () {
  6. var extendStatics = function (d, b) {
  7. extendStatics = Object.setPrototypeOf ||
  8. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  10. return extendStatics(d, b);
  11. };
  12. return function (d, b) {
  13. extendStatics(d, b);
  14. function __() { this.constructor = d; }
  15. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16. };
  17. })();
  18. Object.defineProperty(exports, "__esModule", { value: true });
  19. /**
  20. * 命令基类
  21. */
  22. var BaseCommand_1 = require("../base/BaseCommand");
  23. var Facade_1 = require("../Facade");
  24. var CommandManager_1 = require("../manager/CommandManager");
  25. var SimpleCommand = /** @class */ (function (_super) {
  26. __extends(SimpleCommand, _super);
  27. function SimpleCommand() {
  28. return _super !== null && _super.apply(this, arguments) || this;
  29. }
  30. /**
  31. * 获取model对象
  32. * @param {{new (): BaseModel}} model
  33. */
  34. SimpleCommand.prototype.getModel = function (model) {
  35. return Facade_1.Facade.getInstance().getModel(model);
  36. };
  37. /**
  38. * 执行命令
  39. * @param {{new (): BaseCommand}} command 命令对象
  40. * @param {Object} body 命令参数
  41. */
  42. SimpleCommand.prototype.sendCmd = function (command, body) {
  43. CommandManager_1.default.getInstance().__executeCommand__(command, body);
  44. };
  45. /**
  46. * 撤销命令
  47. * @param {{new (): BaseCommand}} command 命令对象
  48. * @param {Object} body 命令参数
  49. */
  50. SimpleCommand.prototype.undoCmd = function (command, body) {
  51. Facade_1.Facade.getInstance().__undoCommand__(command, body);
  52. };
  53. SimpleCommand.prototype.sendNoti = function () {
  54. };
  55. return SimpleCommand;
  56. }(BaseCommand_1.default));
  57. exports.default = SimpleCommand;
  58. cc._RF.pop();