SlotData.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. Object.defineProperty(i, "__esModule", {value: !0});
  5. const s = {0: "under", 2: "left", 4: "middle", 6: "left"};
  6. i.default = class {
  7. constructor() {
  8. (this.chefPos = null),
  9. (this.selfPos = null),
  10. (this.direction = 0),
  11. (this.machineData = null),
  12. (this.isWorking = !1),
  13. (this.order = null),
  14. (this.ani = null),
  15. (this.node = null),
  16. (this.parentNode = null),
  17. (this.siblingIndex = 0);
  18. }
  19. unlock() {
  20. this.setActive(!0);
  21. }
  22. setActive(t) {
  23. t
  24. ? this.node.parent || this.parentNode.addChild(this.node)
  25. : this.node.parent && this.node.removeFromParent(!1);
  26. }
  27. startCook() {
  28. this.isWorking = !0;
  29. }
  30. playCookAni() {
  31. this.ani && this.ani.play(s[this.direction]);
  32. }
  33. stopCook() {
  34. (this.isWorking = !1), this.ani && (this.ani.stop(), this.ani.setCurrentTime(0, s[this.direction]));
  35. }
  36. updateSiblingIndex() {
  37. this.node.parent && this.node.setSiblingIndex(this.siblingIndex);
  38. }
  39. };