var t = require; var e = module; var i = exports; var s, e = (this && this.__decorate) || function (t, e, i, s) { var o, a = arguments.length, n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s); else for (var r = t.length - 1; 0 <= r; r--) (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n); return 3 < a && n && Object.defineProperty(e, i, n), n; }; Object.defineProperty(i, "__esModule", {value: !0}); const o = t("App"), a = t("GameConst"), n = t("DeskService"), r = t("MapService"), l = t("OrderService"), h = t("RoleService"), c = t("BaseMan"), d = t("Customer"), u = t("OrderDisplay"), p = t("MoveComponent"); ((t = s = s || {})[(t.NONE = 0)] = "NONE"), (t[(t.MOVE_TO_SIT = 1)] = "MOVE_TO_SIT"), (t[(t.SIT_DOWN = 2)] = "SIT_DOWN"), (t[(t.MOVE_TO_EXIT = 3)] = "MOVE_TO_EXIT"); var {ccclass: t} = cc._decorator, t = e( [t], (t = class extends cc.Component { constructor() { super(...arguments), (this.man = null), (this.move = null), (this.state = s.NONE); } onLoad() { (this.man = this.getComponent(d.default)), (this.move = this.getComponent(p.default)); var t = o.default.RandomUtils.limit(3e3, 5e3); (this.man.talkCnt = 0), o.default.TimerManager.doTimer(t, 1, this.showLang, this); } showLang() { h.default.ins.showLang(this.node, a.RoleLangType.COSTUMER_ENTER) && this.man && (this.man.talkCnt = 1); } update(t) { if (this.man.state === c.CharactorState.stand) switch (this.state) { case s.SIT_DOWN: this.man.isEixt && ((this.state = s.MOVE_TO_EXIT), n.default.ins.empPosList.push(this.man.posData), this.move.moveTo(h.default.ins.exit), (this.man.posData = null)); break; case s.NONE: (this.state = s.MOVE_TO_SIT), this.move.moveTo(this.man.posData.sit.pos); break; case s.MOVE_TO_SIT: this.man.sitDown(), l.default.ins.waitOrderList.push({ target: this, cb: this.orderFinish, pos: this.man.posData.staff.pos, direction: this.man.posData.staff.direction }), (this.state = s.SIT_DOWN); break; case s.MOVE_TO_EXIT: h.default.ins.customers.remove(this.man), this.man.destroySelf(); } } orderFinish() { const t = l.default.ins.createOrder(), e = l.default.ins.orderPool.pop(); (e.x = this.node.x + 10), (e.y = this.node.y + this.node.height + 50), r.default.ins.uiLayer.addChild(e); const i = e.addComponent(u.default); (t.display = i), (t.customer = this.man), i.setData(t); var s = r.default.ins.langLayer.children[0]; s && s.x == this.node.x && o.default.NodePoolMsr.roleLangPool.push(s); } }) ); i.default = t;