"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var NetManager_1 = require("../../../libs/tw/manager/NetManager");
var DataManager_1 = require("../../../libs/tw/manager/DataManager");
/**
 * 开始游戏
 * @param callback
 * @param isAgain
 * @param credits
 * @param customizedType
 */
var doStart = function (callback, isAgain, credits, customizedType) {
    if (isAgain === void 0) { isAgain = false; }
    if (window['requirelogin'] && window['config_notrequirelogin'] === undefined) {
        window['requirelogin']();
        return;
    }
    NetManager_1.NetManager.ins.doStart(function (success) {
        if (success) {
            getStartOrderStatus(callback, customizedType);
        }
        else {
            callback(success);
        }
    }, isAgain, credits, customizedType);
};
/**
 * 查询订单结果
 * @param callback
 * @param ticketId
 * @param customizedType
 */
var getStartOrderStatus = function (callback, customizedType) {
    NetManager_1.NetManager.ins.getStartStatus(callback, DataManager_1.DataManager.ins.doStartData.ticketId, function () { return DataManager_1.DataManager.ins.getStartStatusData.code != 1; }, 5, customizedType);
};
exports.default = doStart;
//# sourceMappingURL=doStart.js.map