1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- var t = require;
- var e = module;
- var i = exports;
- Object.defineProperty(i, "__esModule", {value: !0});
- const s = t("App"),
- o = t("GameUtils"),
- a = t("MyBigLong"),
- n = t("DeskService");
- i.default = class {
- constructor() {
- (this.chef = null),
- (this.waiter = null),
- (this.passSectionDesk = null),
- (this.foodPos = null),
- (this.cookDatas = []),
- (this.showSpr = null),
- (this.moneyLab = null);
- }
- addCookData(t) {
- if ((this.cookDatas.push(t), this.showSpr)) this.showSpr.node.active = !0;
- else {
- const t = s.default.NodePoolMsr.passSectionFoodPool.pop();
- (t.zIndex = 4),
- this.passSectionDesk.addChild(t),
- (t.position = this.foodPos),
- (t.x -= this.passSectionDesk.x),
- (t.y -= this.passSectionDesk.y),
- (this.showSpr = t.getComponent(cc.Sprite)),
- (this.moneyLab = t.getComponentInChildren(cc.Label));
- }
- n.default.ins.addCookData(t),
- (this.showSpr.spriteFrame = t.order.display.food.spriteFrame),
- (this.moneyLab.string = a.default.toString(this.getAllMoneyCnt()));
- }
- getAllMoneyCnt() {
- let t = 0;
- for (const e of this.cookDatas) t += e.foodValue;
- return t;
- }
- removeCookData(t) {
- if ((this.cookDatas.remove(t), this.cookDatas.length)) {
- const t = this.cookDatas.last();
- (this.moneyLab.string = a.default.toString(this.getAllMoneyCnt())),
- (this.showSpr.spriteFrame = t.order.display.food.spriteFrame);
- } else this.showSpr.node.active = !1;
- }
- parse(t) {
- var e = t.x,
- i = t.y;
- (this.foodPos = t.getChildByName("Foodsprite").position), (this.foodPos.x += e), (this.foodPos.y += i);
- let s = t.getChildByName("Chef").position;
- (s.x += e),
- (s.y += i),
- (this.chef = {pos: s, direction: o.getDirection(s, this.foodPos)}),
- ((s = t.getChildByName("Cashier").position).x += e),
- (s.y += i),
- (this.waiter = {pos: s, direction: o.getDirection(s, this.foodPos)});
- }
- };
|