123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- 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;
|