"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var NetManager_1 = require("../../libs/tw/manager/NetManager");
var Loading_1 = require("../loading/Loading");
var DataManager_1 = require("../../libs/tw/manager/DataManager");
var NetName_1 = require("../../libs/tw/enum/NetName");
/**
 * 加入游戏
 */
exports.JoinGame = function () {
    Loading_1.default.instace.show();
    return new Promise(function (resolve, reject) {
        NetManager_1.NetManager.ins.doJoin(function (success, res) {
            if (!success) {
                Loading_1.default.instace.hide();
                reject(res);
                return;
            }
            resolve(res);
        });
    });
};
/**
 * 游戏结束提交
 */
exports.Submit = function () {
    Loading_1.default.instace.show();
    return new Promise(function (resolve, reject) {
        NetManager_1.NetManager.ins.getOrderStatus(function (success, res) {
            Loading_1.default.instace.hide();
            if (!success) {
                reject(res);
                return;
            }
            resolve(res); // 返回false
        }, DataManager_1.DataManager.ins.getData(NetName_1.NetName.DO_JOIN_DATA).data, function (res) {
            return res.code != "0000000000";
        }, 10);
    });
};
//# sourceMappingURL=NetConst.js.map