0e200f45-aef9-4428-a092-97b24c4d966d.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. "use strict";
  2. cc._RF.push(module, '0e2009FrvlEKKCSl7JMTZZt', 'AsyncMacroCommand');
  3. // lightMVC/core/command/AsyncMacroCommand.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. */
  23. var MacroCommand_1 = require("./MacroCommand");
  24. var AsyncMacroCommand = /** @class */ (function (_super) {
  25. __extends(AsyncMacroCommand, _super);
  26. function AsyncMacroCommand() {
  27. return _super !== null && _super.apply(this, arguments) || this;
  28. }
  29. /**
  30. * 异步执行组合命令
  31. */
  32. AsyncMacroCommand.prototype.asyncExecute = function () {
  33. var cmdList = this["_commandList"];
  34. for (var _i = 0, cmdList_1 = cmdList; _i < cmdList_1.length; _i++) {
  35. var cmd = cmdList_1[_i];
  36. var tempCmd = new cmd.cmd();
  37. tempCmd.execute(cmd.body);
  38. }
  39. };
  40. /**
  41. * 异步撤销组合命令
  42. */
  43. AsyncMacroCommand.prototype.asyncUndo = function () {
  44. var cmdList = this["_commandList"];
  45. for (var _i = 0, cmdList_2 = cmdList; _i < cmdList_2.length; _i++) {
  46. var cmd = cmdList_2[_i];
  47. var tempCmd = new cmd.cmd();
  48. tempCmd.undo(cmd.body);
  49. }
  50. };
  51. return AsyncMacroCommand;
  52. }(MacroCommand_1.default));
  53. exports.default = AsyncMacroCommand;
  54. cc._RF.pop();