OrderData.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. Object.defineProperty(i, "__esModule", {value: !0});
  5. const s = t("App"),
  6. o = t("DeskService"),
  7. a = t("CookData");
  8. i.default = class {
  9. constructor() {
  10. (this.customer = null), (this.machine = null), (this.display = null), (this.cnt = 1), (this.cookingCnt = 0);
  11. }
  12. canCook() {
  13. return this.cnt > this.cookingCnt ? this.machine.getEmpSlot() : null;
  14. }
  15. getFoodValue() {
  16. return this.machine.attr.value;
  17. }
  18. finishCook() {}
  19. finishOrder() {
  20. this.cnt--,
  21. this.cookingCnt--,
  22. this.cnt
  23. ? this.display.setCnt(this.cnt)
  24. : (this.display.destroySelf(), (this.display = null), this.customer.exit(this));
  25. }
  26. startCook() {
  27. const t = this.machine.getEmpSlot();
  28. t.startCook(), (t.order = this);
  29. const e = new a.default();
  30. return (
  31. (e.order = this),
  32. (e.slot = t),
  33. (e.passSectionData = s.default.RandomUtils.randomArray(o.default.ins.passSectionDatas)),
  34. e
  35. );
  36. }
  37. };