"use strict";
var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var __extends = this && this.__extends || function __extends(t, e) { 
 function r() { 
 this.constructor = t;
}
for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
r.prototype = e.prototype, t.prototype = new r();
};
Object.defineProperty(exports, "__esModule", { value: true });
var Panel_1 = require("../views/Panel");
var TaskToast = (function (_super) {
    __extends(TaskToast, _super);
    function TaskToast(data) {
        return _super.call(this, data) || this;
        // this.data = data;
    }
    Object.defineProperty(TaskToast.prototype, "skinKey", {
        get: function () {
            return 'TaskToast';
        },
        enumerable: true,
        configurable: true
    });
    TaskToast.prototype.onShowAnim = function () {
    };
    TaskToast.prototype.initEvents = function () {
        _super.prototype.initEvents.call(this);
        // this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_this, this);
    };
    TaskToast.prototype.removeEvents = function () {
        _super.prototype.removeEvents.call(this);
        // this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.ontap_this, this);
    };
    TaskToast.prototype.start = function () {
        _super.prototype.start.call(this);
        this.title.text = this.data.title;
        this.foodLabel.text = "×" + this.data.food;
        this.waterLabel.text = "×" + this.data.water;
        if (this.data.food <= 0) {
            this.foodGroup.visible = false;
            this.waterGroup.x = 162;
        }
        if (this.data.water <= 0) {
            this.waterGroup.visible = false;
            this.foodGroup.x = 162;
        }
        var canvasW = 750 / window.innerWidth * window.innerWidth;
        var canvasH = 750 / window.innerWidth * window.innerHeight;
        this.anchorOffsetX = this.width / 2;
        this.anchorOffsetY = this.height / 2;
        this.x = canvasW / 2;
        this.y = canvasH / 2;
        egret.Tween.removeTweens(this);
        egret.Tween.get(this)
            .set({ scaleX: 0, scaleY: 0 })
            .to({ scaleX: 1, scaleY: 1 }, 330, egret.Ease.backOut)
            .wait(1200)
            .to({ alpha: 0 }, 500, egret.Ease.quadInOut)
            .call(this.onTouchClose.bind(this));
    };
    return TaskToast;
}(Panel_1.default));
exports.default = TaskToast;
__reflect(TaskToast.prototype, "\"/Users/haiyoucuv/Documents/Web/\u5DE5\u884C\u5361\u4E2D\u5FC3--\u6B22\u8DA3\u5E84\u56ED\u6D3B\u52A8/JoyousManor/egret/src/Panels/TaskToast\".TaskToast");
//# sourceMappingURL=TaskToast.js.map