1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- 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("ControllerConst"),
- n = t("NotificationConst"),
- r = t("BaseService"),
- l = t("MachineService"),
- {ccclass: h} = cc._decorator;
- t = s = class extends r.default {
- constructor() {
- super(...arguments), (this.mapSaveData = null), (this.player = null);
- }
- onLoad() {
- s.ins = this;
- }
- init() {
- const t = o.default.ControllerManager.getControllerModel(a.ControllerConst.Game);
- (this.mapSaveData = t.getCurMapData()), (this.player = o.default.GameDataMsr.playerInfo);
- }
- desotrySelf() {}
- checkMoneyEnough(t) {
- return this.mapSaveData.money >= t;
- }
- checkDiamondEnough(t) {
- return this.player.diamond >= t;
- }
- diamondChange(t) {
- return !(
- (t < 0 && this.player.diamond < -t) ||
- ((this.player.diamond += t),
- o.default.NotificationCenter.dispatch(n.NotificationConst.UPDATE_SUPER_CASH, this.player.diamond, t),
- 0)
- );
- }
- addMoneyByIdle(t) {
- this.moneyChange(l.default.ins.calculateIdleMoney(t, !0));
- }
- getIdleMoney(t) {
- return l.default.ins.calculateIdleMoney(t, !0);
- }
- moneyChange(t) {
- return !(
- (t < 0 && this.mapSaveData.money < -t) ||
- ((this.mapSaveData.money += t),
- o.default.NotificationCenter.dispatch(n.NotificationConst.UPDATE_MONEY, this.mapSaveData.money, t),
- 0)
- );
- }
- };
- (t.ins = null), (t = s = e([h], t)), (i.default = t = s);
|