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 (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var GameScore = (function (_super) {
    __extends(GameScore, _super);
    function GameScore() {
        var _this = _super.call(this) || this;
        _this.bg = AssetManager.createBitmapByName("gameScore_bg_png");
        return _this;
    }
    GameScore.prototype.init = function () {
        this.bg.x = this.stage.stageWidth / 2;
        this.bg.y = this.stage.stageHeight / 2;
        this.addChild(this.bg);
        this.txt = new egret.TextField();
        var t = new Date().getTime() - userGameData.startTime;
        var m = Math.floor(t / 60000);
        console.log(userGameData.startTime, userGameData.suicideTime);
        var suicideTime = userGameData.suicideTime;
        var packageNum = userGameData.package.length;
        var packagePercent = Math.floor(packageNum / 16 * 100);
        var roleIds = [];
        for (var i = 0, len = userGameData.roles.length; i < len; i++) {
            var r = userGameData.roles[i];
            if (roleIds.indexOf(r.id) == -1) {
                roleIds.push(r.id);
            }
        }
        var roleNum = roleIds.length;
        var rolePercent = Math.floor(roleNum / 7 * 100);
        this.txt.text = "游戏时间： " + m + "分钟" +
            "\n\n" +
            "自杀次数： " + suicideTime +
            "\n\n" +
            "收集道具： " + packagePercent + "%" +
            "\n\n" +
            "收集角色： " + rolePercent + "%";
        this.txt.x = 100;
        this.txt.size = 48;
        this.txt.y = 300;
        this.txt.multiline = true;
        this.txt.width = 400;
        this.addChild(this.txt);
        this.touchEnabled = true;
        this.addEventListener(egret.TouchEvent.TOUCH_END, this.onTouch, this);
        packageList.visible = false;
    };
    GameScore.prototype.onTouch = function (e) {
        this.next("gameStart");
    };
    return GameScore;
}(Scene));
__reflect(GameScore.prototype, "GameScore");
//# sourceMappingURL=GameScore.js.map