"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 });
// import { GPool } from '../../../../tc/util/GPool';
var LotteryData_1 = require("../../common/lottery/LotteryData");
var Data_1 = require("../../Data");
var GPool_1 = require("../../../../tc/util/GPool");
/**
 *Created by cuiliqiang on 2018/3/8
 * 查询插件订单结果
 */
var GetPlugOrderStatusData = (function (_super) {
    __extends(GetPlugOrderStatusData, _super);
    function GetPlugOrderStatusData() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    GetPlugOrderStatusData.prototype.update = function (result) {
        if (!result) {
            return;
        }
        _super.prototype.update.call(this, result);
        this.result = result.result;
        if (result.exposure) {
            this.exposure = result.exposure;
        }
        else if (this.exposure) {
            this.exposure = null;
        }
        if (result.lottery && result.lottery.type != 'thanks') {
            this.lottery = GPool_1.GPool.takeOut('LotteryData', LotteryData_1.LotteryData);
            if (!this.lottery) {
                this.lottery = new LotteryData_1.LotteryData();
            }
            this.lottery.update(result.lottery);
        }
        else {
            GPool_1.GPool.recover('LotteryData', this.lottery);
            this.lottery = null;
        }
    };
    return GetPlugOrderStatusData;
}(Data_1.Data));
exports.GetPlugOrderStatusData = GetPlugOrderStatusData;
__reflect(GetPlugOrderStatusData.prototype, "\"/Users/chiwang/Desktop/\u5151\u5427\u5DE5\u4F5C/gameegret20181011/db-game-template/egret/libs/tw/data/plug/doJoinPlugDraw/GetPlugOrderStatusData\".GetPlugOrderStatusData");
//# sourceMappingURL=GetPlugOrderStatusData.js.map