"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var TimeProgressBar_1 = require("./TimeProgressBar");
var MainScene_1 = require("./MainScene");
var ProgressMgr = (function () {
    function ProgressMgr() {
        this.progressBars = {};
    }
    ProgressMgr.prototype.addProgress = function (data) {
        /// TODO 根据数据添加进度条
        var x = data.x, y = data.y, index = data.index, title = data.title, label = data.label, sTime = data.sTime, nTime = data.nTime, eTime = data.eTime;
        var progressBar = new TimeProgressBar_1.default(index, title, label, sTime, nTime, eTime);
        progressBar.x = x;
        progressBar.y = y;
        MainScene_1.MainIns().gameLayer.addChildAt(progressBar, 80);
        this.progressBars[index] = progressBar;
        return progressBar;
    };
    ProgressMgr.prototype.removeProgress = function (index) {
        if (this.progressBars[index]) {
            this.progressBars[index].destroy();
            MainScene_1.MainIns().gameLayer.removeChild(this.progressBars[index]);
            this.progressBars[index] = null;
            delete this.progressBars[index];
        }
    };
    ProgressMgr.prototype.destroy = function () {
        for (var k in this.progressBars) {
            this.progressBars[k].destroy();
            this.removeProgress(k);
        }
        this.progressBars = {};
    };
    return ProgressMgr;
}());
exports.default = ProgressMgr;
__reflect(ProgressMgr.prototype, "\"/Users/haiyoucuv/Documents/Web/\u5DE5\u884C\u5361\u4E2D\u5FC3--\u6B22\u8DA3\u5E84\u56ED\u6D3B\u52A8/JoyousManor/egret/src/Scenes/MainScene/ProgressMgr\".ProgressMgr");
//# sourceMappingURL=ProgressMgr.js.map