"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 LotteryData_1 = require("./../../common/lottery/LotteryData");
var Data_1 = require("./../../Data");
var GPool_1 = require("../../../../tc/util/GPool");
/**
 * 获取游戏抽奖结果
 */
var GameGetSubmitResultData = (function (_super) {
    __extends(GameGetSubmitResultData, _super);
    function GameGetSubmitResultData() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    GameGetSubmitResultData.prototype.update = function (result) {
        if (!result) {
            return;
        }
        _super.prototype.update.call(this, result);
        this.flag = result.data.flag;
        if (result.data.option) {
            this.lottery = GPool_1.GPool.takeOut('LotteryData', LotteryData_1.LotteryData);
            if (!this.lottery) {
                this.lottery = new LotteryData_1.LotteryData();
            }
            if (!result.data.option.lottery) {
                result.data.option.lottery = {};
            }
            result.data.option.lottery.type = result.data.option.type;
            result.data.option.lottery.stinfodpmgouse = result.data.useDpm;
            result.data.option.lottery.stinfodpmimg = result.data.useDpm;
            result.data.option.lottery.imgurl = result.data.option.image;
            result.data.option.lottery.link = result.data.option.link;
            result.data.option.lottery.name = result.data.option.name;
            result.data.option.lottery.type = result.data.option.type;
            this.lottery.update(result.data.option.lottery);
        }
        else if (this.lottery) {
            GPool_1.GPool.recover('LotteryData', this.lottery);
            this.lottery = null;
        }
        if (this.lottery) {
            this.exposure = result.data.option.lottery.exposure;
        }
        else if (this.exposure) {
            this.exposure = null;
        }
        this.againExposure = JSON.parse(result.data.againDpm);
        this.score = result.data.score;
    };
    return GameGetSubmitResultData;
}(Data_1.Data));
exports.GameGetSubmitResultData = GameGetSubmitResultData;
__reflect(GameGetSubmitResultData.prototype, "\"/Users/chiwang/Desktop/\u5151\u5427\u5DE5\u4F5C/gameegret20181011/db-game-template/egret/libs/tw/data/game/submit/GameGetSubmitResultData\".GameGetSubmitResultData");
//# sourceMappingURL=GameGetSubmitResultData.js.map